Class: Minix

Inherits:
Object
  • Object
show all
Defined in:
lib/guess_os/type/minix.rb

Class Method Summary collapse

Class Method Details

.guess(host) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/guess_os/type/minix.rb', line 2

def self.guess(host)
  conn = GuessOS::Conn.new(host)
  command = "cat /etc/rc.d/minixrc |grep MINIX| head -n 1"
  conn.exec(command)

  identified = conn.ok && conn.last_output.include?("MINIX")
  return GuessOS::OS.unkown unless identified

  output = conn.last_output
  type = :minix
  name = "minix"
  desc = output.delete("\n")
  GuessOS::OS.new(type, name, desc)
end