1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00
iiab/roles/openvpn/templates/iiab-remote-off

20 lines
388 B
Text
Raw Normal View History

2017-06-12 22:42:32 +00:00
#!/bin/bash
# script to turn on openvpn
# do nothing if it is not installed
which openvpn
if [ $? -ne 0 ]; then
2018-04-29 06:25:14 +00:00
echo Cannot find the openvpn program.
exit 1
2017-06-12 22:42:32 +00:00
fi
systemctl disable openvpn@xscenet.service
systemctl stop openvpn@xscenet.service
sleep 5
ps -e|grep vpn
if [ $? -eq 0 ]; then
2018-04-29 06:25:14 +00:00
echo Openvpn failed to stop.
2017-06-12 22:42:32 +00:00
else
2018-04-29 06:25:14 +00:00
echo Successfully stopped and disabled Openvpn
2017-06-12 22:42:32 +00:00
fi