1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/openvpn/templates/iiab-remote-on

20 lines
407 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:38:00 +00:00
echo Cannot find the OpenVPN program (openvpn).
2018-04-29 06:24:41 +00:00
exit 1
2017-06-12 22:42:32 +00:00
fi
systemctl enable openvpn@xscenet.service
systemctl start openvpn@xscenet.service
sleep 5
ping -c 2 10.8.0.1
if [ $? -eq 0 ]; then
2018-04-29 06:38:00 +00:00
echo OpenVPN successfully started.
2017-06-12 22:42:32 +00:00
else
2018-04-29 06:38:00 +00:00
echo OpenVPN failed to contact remote server.
2017-06-12 22:42:32 +00:00
fi