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-on.j2
2018-09-05 11:26:58 -04:00

19 lines
412 B
Django/Jinja

#!/bin/bash
# script to turn on openvpn
# do nothing if it is not installed
which openvpn
if [ $? -ne 0 ]; then
echo Cannot find the OpenVPN program (openvpn).
exit 1
fi
systemctl enable openvpn
systemctl start openvpn
sleep 5
ping -c 2 {{ openvpn_server_virtual_ip }} # 10.8.0.1
if [ $? -eq 0 ]; then
echo OpenVPN successfully started.
else
echo OpenVPN failed to contact remote server.
fi