dotfiles/scripts/prefix/bin/vpn

13 lines
219 B
Text
Raw Normal View History

2016-03-18 17:59:50 +01:00
#!/bin/sh
PROFILE=$(hostname)
2016-09-04 03:29:23 +02:00
2017-02-10 18:41:08 +01:00
sudo systemctl stop openvpn-client@$PROFILE.service
2016-03-18 17:59:50 +01:00
2017-02-23 17:24:06 +01:00
if [[ $1 = "on" ]]
2016-09-04 03:29:23 +02:00
then
2017-02-10 18:41:08 +01:00
sudo systemctl start openvpn-client@$PROFILE.service
echo "$PROFILE started"
2016-09-04 03:29:23 +02:00
else
2017-02-23 17:24:06 +01:00
echo "All stopped."
2016-09-04 03:29:23 +02:00
fi