Cleaning vpn script
This commit is contained in:
parent
8efc5ad92f
commit
986b5eca5f
1 changed files with 8 additions and 37 deletions
|
@ -1,43 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
HARDPROFILE="2947fbbad4"
|
PROFILE="Felin"
|
||||||
if [[ $(hostname) == "DeathStar" ]]
|
|
||||||
|
sudo systemctl stop openvpn-client@$PROFILE.service
|
||||||
|
|
||||||
|
if [[ $1 = "on" ]]
|
||||||
then
|
then
|
||||||
OODPROFILE="OodDeathStar"
|
sudo systemctl start openvpn-client@$PROFILE.service
|
||||||
else
|
|
||||||
OODPROFILE="OodCanine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $# -ne 1 ]]
|
|
||||||
then
|
|
||||||
echo "$(basename $0) requires exactly one of: hard, medium, off"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
case $1 in
|
|
||||||
"hard")
|
|
||||||
PROFILE=$HARDPROFILE
|
|
||||||
;;
|
|
||||||
"medium")
|
|
||||||
PROFILE=$OODPROFILE
|
|
||||||
;;
|
|
||||||
"off")
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Wrong command, either hard, medium or off"
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
sudo systemctl stop openvpn@$HARDPROFILE.service
|
|
||||||
sudo systemctl stop openvpn@$OODPROFILE.service
|
|
||||||
sleep 1s
|
|
||||||
|
|
||||||
if [[ -n $PROFILE ]]
|
|
||||||
then
|
|
||||||
sudo systemctl start openvpn@$PROFILE.service
|
|
||||||
echo "$PROFILE started"
|
echo "$PROFILE started"
|
||||||
else
|
else
|
||||||
echo "All stopped."
|
echo "All stopped."
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue