Ajout de scripts de dtection de la connexion de secours pour le tunnel openvpn avec OVH
darcs-hash:20080106195252-61eff-7b7b8e75e4c6771f02618081fcedaf90db85eaca.gz
This commit is contained in:
parent
0de49997df
commit
4f1426e20b
2 changed files with 43 additions and 0 deletions
15
secours/check-vpn-from-crans
Executable file
15
secours/check-vpn-from-crans
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/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
|
28
secours/check-vpn-from-ovh
Executable file
28
secours/check-vpn-from-ovh
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
VPN_NAME=adm
|
||||||
|
|
||||||
|
if { ! ps -p $(< /var/run/openvpn.${VPN_NAME}.pid) > /dev/null; }; then
|
||||||
|
if fping -q komaz.crans.org; then
|
||||||
|
sed -i'~' 's/freebox/komaz/g' /etc/openvpn/${VPN_NAME}.conf
|
||||||
|
if /etc/init.d/openvpn start ${VPN_NAME} > /dev/null; then
|
||||||
|
echo "Lancement du tunnel vers komaz reussi !"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Echec du lancement du tunnel vers komaz !"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif fping -q freebox.crans.org; then
|
||||||
|
sed -i'~' 's/komaz/freebox/g' /etc/openvpn/${VPN_NAME}..conf
|
||||||
|
if /etc/init.d/openvpn start ${VPN_NAME} > /dev/null; then
|
||||||
|
echo "Lancement du tunnel vers freebox reussi !"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Echec du lancement du tunnel vers freebox !"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Impossible de determiner un point d'acces au CRANS !"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Add table
Add a link
Reference in a new issue