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")
|
2016-03-21 15:41:20 +01:00
|
|
|
[[ $(hostname) == "DeathStar" ]] && PROFILE="OodDeathStar" || PROFILE="OodCanine"
|
2016-03-18 17:59:50 +01:00
|
|
|
;;
|
|
|
|
"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
|
|
|
|
|