15 lines
425 B
Bash
Executable file
15 lines
425 B
Bash
Executable file
#!/bin/sh
|
|
|
|
VPN_NAME=ovh
|
|
|
|
if { ! ps -p $(< /var/run/openvpn.${VPN_NAME}.pid) > /dev/null; } && { ! fping -q ovh.adm.crans.org; }; then
|
|
if fping -q ovh.crans.org; then
|
|
if /etc/init.d/openvpn start ${VPN_NAME} > /dev/null; then
|
|
echo "Lancement du tunnel vers OVH reussi !"
|
|
exit 0
|
|
else
|
|
echo "Echec du lancement du tunnel vers OVH !"
|
|
exit 1
|
|
fi
|
|
fi
|
|
fi
|