diff --git a/scripts/prefix/bin/vpn b/scripts/prefix/bin/vpn index e3f24c6..af5dc08 100755 --- a/scripts/prefix/bin/vpn +++ b/scripts/prefix/bin/vpn @@ -1,5 +1,13 @@ #!/bin/sh +HARDPROFILE="2947fbbad4" +if [[ $(hostname) == "DeathStar" ]] +then + OODPROFILE="OodDeathStar" +else + OODPROFILE="OodCanine" +fi + if [[ $# -ne 1 ]] then echo "$(basename $0) requires exactly one of: hard, medium, off" @@ -7,10 +15,10 @@ then else case $1 in "hard") - PROFILE="2947fbbad4" + PROFILE=$HARDPROFILE ;; "medium") - [[ $(hostname) == "DeathStar" ]] && PROFILE="OodDeathStar" || PROFILE="OodCanine" + PROFILE=$OODPROFILE ;; "off") ;; @@ -20,14 +28,16 @@ else ;; esac - sudo systemctl stop openvpn@2947fbbad4.service - sudo systemctl stop openvpn@OodCanine.service + 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" + else + echo "All stopped." fi - echo "$PROFILE started" fi