Sha256: f672714fab8f2d6a3defae252190888c24d497fe212be504a0347bbd8119548e
Contents?: true
Size: 533 Bytes
Versions: 77
Compression:
Stored size: 533 Bytes
Contents
module CFMicro::Switcher class Linux < Base def set_nameserver(domain, ip) CFMicro.run_command("sudo", "sed -i'.backup' '1 i nameserver #{ip}' /etc/resolv.conf") # lock resolv.conf so Network Manager doesn't clear out the file when offline CFMicro.run_command("sudo", "chattr +i /etc/resolv.conf") end def unset_nameserver(domain, ip) CFMicro.run_command("sudo", "chattr -i /etc/resolv.conf") CFMicro.run_command("sudo", "sed -i'.backup' '/#{ip}/d' /etc/resolv.conf") end end end
Version data entries
77 entries across 77 versions & 3 rubygems