Sha256: 1b0985024a9126c682bc455d09238f2072bdae4e1debf6013658b9ebdc142f16
Contents?: true
Size: 541 Bytes
Versions: 151
Compression:
Stored size: 541 Bytes
Contents
module VMC::Micro::Switcher class Darwin < Base def adminrun(command) VMC::Micro.run_command("osascript", "-e 'do shell script \"#{command}\" with administrator privileges'") end def set_nameserver(domain, ip) File.open("/tmp/#{domain}", 'w') { |file| file.write("nameserver #{ip}") } adminrun("mkdir -p /etc/resolver;mv /tmp/#{domain} /etc/resolver/") end def unset_nameserver(domain, ip) err "domain missing" unless domain adminrun("rm -f /etc/resolver/#{domain}") end end end
Version data entries
151 entries across 151 versions & 9 rubygems