diff --git a/secours/check-vpn-from-ovh b/secours/check-vpn-from-ovh index 98d004fc..6d4485c8 100644 --- a/secours/check-vpn-from-ovh +++ b/secours/check-vpn-from-ovh @@ -4,10 +4,7 @@ vpn_is_running () { local pid_file pid_file=/var/run/openvpn.$1.pid if [ -f $pid_file ] && [ -d /proc/$(< $pid_file) ] - then if fping komaz.adm.crans.org &> /dev/null - then return 0 - else return 1 - fi + then return 0 else return 1 fi } @@ -32,7 +29,7 @@ vpn_start () { fi } -if vpn_is_running komaz; then +if vpn_is_running komaz && fping -q komaz.adm.crans.org; then # Le vpn vers komaz est actif, tout va bien exit 0 fi @@ -51,7 +48,7 @@ if fping -q komaz.crans.org; then vpn_start komaz fi -if vpn_is_running freebox; then +if vpn_is_running freebox && fping -q komaz.adm.crans.org; then # On ne peut pas atteindre komaz et on passe par la freebox, c'est # normal exit 0