Skip to content

Instantly share code, notes, and snippets.

@celadevra
Created July 31, 2012 03:12
Show Gist options
  • Save celadevra/3213188 to your computer and use it in GitHub Desktop.
Save celadevra/3213188 to your computer and use it in GitHub Desktop.
Fix chnroute minor bug under mac
# If you use chnroutes.py generated ip-up to add to route table addresses
# that don't route through VPN, you may encounter error saying
# "bad address:\n $yourgateway" where $yourgateway is the gate way for
# non-VPN addresses. This is because the \n is not accepted by OS X's route
# command. Just remove the \n with another sed command:
OLDGW=`netstat -nr | grep '^default' | grep -v 'ppp' | sed 's/default *\([0-9\.]*\) .*/\1/' | sed '/^$/d'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment