Skip to content

Instantly share code, notes, and snippets.

@amcorreia
Forked from mrngm/sciencevpn.sh
Created August 11, 2014 23:19
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 amcorreia/27b14ecc5c5e2152c9b6 to your computer and use it in GitHub Desktop.
Save amcorreia/27b14ecc5c5e2152c9b6 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