lib/ssh_scan/os/raspbian.rb in ssh_scan-0.0.20 vs lib/ssh_scan/os/raspbian.rb in ssh_scan-0.0.21
- old
+ new
@@ -16,9 +16,14 @@
def initialize(banner)
@banner = banner
@version = Raspbian::Version.new(raspbian_version_guess)
end
+ # Guess Raspbian OS version. Typically, Raspbian banners
+ # are like "SSH-2.0-Raspbian-something", where something
+ # is the Raspbian version.
+ # @return [String] version string matched from banner, nil
+ # if not matched
def raspbian_version_guess
return nil if @banner.nil?
match = @banner.match(/SSH-2.0-Raspbian-(\d+)/)
return nil if match.nil?
return match[1]