dotfiles/scripts/prefix/bin/vpn

34 lines
561 B
Text
Raw Normal View History

2016-03-18 17:59:50 +01:00
#!/bin/sh
if [[ $# -ne 1 ]]
then
echo "$(basename $0) requires exactly one of: hard, medium, off"
exit 1
else
case $1 in
"hard")
PROFILE="2947fbbad4"
;;
"medium")
PROFILE="OodCanine"
;;
"off")
;;
*)
echo "Wrong command, either hard, medium or off"
exit 2
;;
esac
sudo systemctl stop openvpn@2947fbbad4.service
sudo systemctl stop openvpn@OodCanine.service
sleep 1s
if [[ -n $PROFILE ]]
then
sudo systemctl start openvpn@$PROFILE.service
fi
echo "$PROFILE started"
fi