Advertisement
blinkingstar

SOCKS Bash

Nov 2nd, 2019
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. case "$1" in
  4.   "start" | "wear" ) echo "Wear socks"
  5.     launchctl load ~/Library/LaunchAgents/net.blinkingstar.homesocks.plist && launchctl start net.blinkingstar.homesocks
  6.     sudo networksetup -setsocksfirewallproxy Ethernet localhost 1080
  7.     sudo networksetup -setsocksfirewallproxystate Ethernet on ;;
  8.   "stop" | "off" ) echo "Take off socks"
  9.     launchctl unload ~/Library/LaunchAgents/net.blinkingstar.homesocks.plist
  10.     sudo networksetup -setsocksfirewallproxystate Ethernet off
  11.     sudo networksetup -setsocksfirewallproxystate Ethernet off ;;
  12.     * ) echo "start or stop" ;;
  13. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement