confine :kernel => :linux
addrs = []
if FileTest.exist?("/bin/ip")
- %x{ip addr list}.each do |line|
+ %x{ip addr list}.each_line do |line|
next unless line =~ /\s+inet/
next if line =~ /scope (link|host)/
if line =~ /\s+inet\s+(\S+)\/\d{1,2} .*/
confine :kernel => :linux
addrs = []
if FileTest.exist?("/bin/ip")
- %x{ip addr list}.each do |line|
+ %x{ip addr list}.each_line do |line|
next unless line =~ /\s+inet/
next if line =~ /scope (link|host)/
if line =~ /\s+inet6\s+(\S+)\/\d{1,3} .*/