Skip to content

Instantly share code, notes, and snippets.

@hex128
Created August 20, 2016 13:24
Show Gist options
  • Save hex128/8835691c36fc299e63be85ed09bec408 to your computer and use it in GitHub Desktop.
Save hex128/8835691c36fc299e63be85ed09bec408 to your computer and use it in GitHub Desktop.
PPTP route configuration script
#!/bin/sh
RELEVANT=remote
LOG=/dev/null
ROUTE=192.0.2.0/24
echo "$0 $@" >> ${LOG}
address=$4
gateway=$5
ipparam=$6
if [ ${ipparam} != ${RELEVANT} ]; then
echo "ipparam \"${ipparam}\" != \"${RELEVANT}\", ignoring" >> ${LOG}
exit
fi
echo "adding routes" >> ${LOG}
ip route add ${ROUTE} via ${address}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment