Method: MacWifi::BaseModel#nameservers
- Defined in:
- lib/mac-wifi/base_model.rb
#nameservers ⇒ Object
Though this is strictly not OS-agnostic, it will be used by most OS’s, and can be overridden by subclasses (e.g. Windows).
233 234 235 236 237 238 239 |
# File 'lib/mac-wifi/base_model.rb', line 233 def nameservers begin File.readlines('/etc/resolv.conf').grep(/^nameserver /).map { |line| line.split.last } rescue Errno::ENOENT nil end end |