Last active
April 23, 2016 02:03
-
-
Save 0x62/a3099bd046deb801955e to your computer and use it in GitHub Desktop.
AppleScript to update DNS servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
display dialog "What is your pass word?" default answer "" | |
set pass to text returned of result | |
display dialog "Primary DNS server" default answer "" | |
set dns1 to text returned of result | |
display dialog "Secondary DNS server" default answer "" | |
set dns2 to text returned of result | |
tell application "Terminal" to activate | |
tell application "Terminal" | |
do script ("echo " & pass & " | sudo -S networksetup -setdnsservers Wi-Fi " & dns1 & " " & dns2) in window 1 | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment