-
-
Save amcorreia/27b14ecc5c5e2152c9b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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