A script developed for colleagues to quickly switch the environment of the home and Unit
Tell application "system events"
Set proxy_dialog to display dialog "proxy module (Ethernet version):" Buttons {"enable proxy Mode 1", "enable proxy Mode 2 ", "Disable proxy"} default button "enable proxy Mode 1"
With title "quickly switch proxy app in Huaxia Fund Development Environment"
Set proxy_interface to button returned of proxy_dialog
End tell
If proxy_interface is "enable proxy Mode 1" then
Do shell script "networksetup-setwebproxy Ethernet 11.1.1.1 3128 & networksetup-setsecurewebproxy Ethernet 1.1.1.111 8080 & networksetup-setwebproxystate Ethernet on & networksetup-setsecurewebproxystate Ethernet on" with Administrator
Privileges
End if
If proxy_interface is "enable proxy Mode 2" then
Do shell script "networksetup-setwebproxy Ethernet 1.1.1.1 3128 & networksetup-setsecurewebproxy Ethernet 1.1.1.1 8080 & networksetup-setwebproxystate Ethernet on & networksetup-setsecurewebproxystate Ethernet on" with Administrator
Privileges
End if
If proxy_interface is "Disable proxy" then
Do shell script "networksetup-setwebproxystate Ethernet off & networksetup-setsecurewebproxystate Ethernet off" with administrator privileges
End if