Module: Salticid::Host::IP

Defined in:
lib/salticid/host/ip.rb

Instance Method Summary collapse

Instance Method Details

#ipsObject

Get all active IP addresses.


5
6
7
8
9
10
11
12
# File 'lib/salticid/host/ip.rb', line 5

def ips
  `ifconfig -a`.split("\n\n").map { |stanza|
    stanza.split("\n").find { |line|
      line =~ /inet addr:\s*([\d\.]{7..15})/
      $1
    }
  }.compact
end

#private_ipsObject


14
15
# File 'lib/salticid/host/ip.rb', line 14

def private_ips
end

#public_ipsObject


17
18
# File 'lib/salticid/host/ip.rb', line 17

def public_ips
end