Last active
April 4, 2019 00:04
-
-
Save oakaigh/3c250b8c7a114273b9468f119239e819 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
INTERFACE=$(networksetup -listnetworkserviceorder | awk -F'\\) ' '/\(1\)/ {print $2}') | |
ADDRESS=localhost; PORT=1080 | |
if networksetup -getsocksfirewallproxy ${INTERFACE} | grep -q "Yes"; then | |
networksetup -setsocksfirewallproxystate ${INTERFACE} off | |
osascript -e 'display notification "eLitet JSOCA disconnected" with title "eLitet Service" sound name "default"' ;; | |
else | |
networksetup -setsocksfirewallproxy ${INTERFACE} ${ADDRESS} ${PORT} on | |
osascript -e 'display notification "eLitet JSOCA connected" with title "eLitet Service" sound name "default"' ;; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment