Wednesday, December 10, 2014

MAC Applescript to toggle Safari Socks Proxy State

Mac Yosemite

Toggle Socks proxy state in safari using Apple script

set socksStatus to do shell script "networksetup -getsocksfirewallproxy Wi-fi | grep Enabled"

if (offset of "Yes" in socksStatus) = 0 then
do shell script "networksetup -setsocksfirewallproxystate Wi-fi On"
display notification "Status: Socks Enabled" & socksStatus
else
do shell script "networksetup -setsocksfirewallproxystate Wi-fi Off"
display notification "Status: Socks disabled" & socksStatus

end if

No comments :

Post a Comment