Useful when you often have to switch between your routers DNS and for example Unblock-Us.
set dnsList to {"Unblock US", "Default"} set selectedDNS to {choose from list dnsList with title "DNS Server to set"} display dialog "Admin Password to change network settings" default answer "" set pw to text returned of result log item 1 of selectedDNS log "test" if item 1 of selectedDNS is {"Unblock Us"} then log "Unblock US" do shell script "networksetup -setdnsservers Wi-Fi 208.122.23.23" user name "fred" password pw with administrator privileges else if item 1 of selectedDNS is {"Default"} then log "Default DNS" do shell script "networksetup -setdnsservers Wi-Fi 192.168.1.1" user name "fred" password pw with administrator privileges else log "Got no valid value" end if
Keine Kommentare:
Kommentar veröffentlichen