Skip to content

Instantly share code, notes, and snippets.

@mrngm
Created October 18, 2013 09:07
Show Gist options
  • Save mrngm/7038770 to your computer and use it in GitHub Desktop.
Save mrngm/7038770 to your computer and use it in GitHub Desktop.
# cat sciencevpn.sh
#!/bin/bash
ARGC=$#
if [[ "$ARGC" -lt "1" ]]; then
echo "Usage: $0 [on|off]"
exit 0;
fi
if [[ "$1" == "on" ]]; then
pptpsetup --create radboud --server vpn-srv.science.ru.nl --username "" --password "" --encrypt --start
ip r a 131.174.0.0/16 via `ip a s dev ppp0 | grep inet | cut -d ' ' -f 6`
exit 0;
fi
if [[ "$1" == "off" ]]; then
ip r d 131.174.0.0/16 dev ppp0
pptpsetup --delete radboud
kill `pidof pptp`
exit 0;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment