Skip to content

Instantly share code, notes, and snippets.

@sckn
Created May 1, 2017 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sckn/e664c9770e9abe7d401c5cd5d1769603 to your computer and use it in GitHub Desktop.
Save sckn/e664c9770e9abe7d401c5cd5d1769603 to your computer and use it in GitHub Desktop.
Change gateway
#!/bin/bash
# vim /usr/local/bin/cgw
# chmod +x /usr/local/bin/cgw
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I|grep My_Home_SSID >/dev/null || exit 0
route delete default
route add default 10.1.1.40
networksetup -setdnsservers Wi-Fi 10.1.1.40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment