diff --git a/lib/uuidtools.rb b/lib/uuidtools.rb index acbbb78..ed65fd5 100644 --- a/lib/uuidtools.rb +++ b/lib/uuidtools.rb @@ -636,9 +636,13 @@ def self.ifconfig(all=nil) # if it does not exist, try the ip command if ifconfig_path == nil - ifconfig_path = "#{UUID.ip_path} addr list" - # all makes no sense when using ip(1) - all = nil + ip_path = UUID.ip_path + # check to make sure ip exists + unless ip_path.nil? + ifconfig_path = "#{ip_path} addr list" + # all makes no sense when using ip(1) + all = nil + end end all_switch = all == nil ? "" : "-a"