public:recetas:openwrt-tp-link740
Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anteriorRevisión previa | |||
public:recetas:openwrt-tp-link740 [2016/10/12 20:20] – [Configurar vpnc] boronat | public:recetas:openwrt-tp-link740 [2017/08/21 06:50] (actual) – [Configurar vpnc] mperez | ||
---|---|---|---|
Línea 249: | Línea 249: | ||
else | else | ||
echo Alive $1 or $2 | echo Alive $1 or $2 | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | Una alternativa que realiza hasta 3 pings (o n) a las IPs dadas y comprueba si se han perdido todos: | ||
+ | |||
+ | < | ||
+ | #!/bin/sh | ||
+ | # | ||
+ | |||
+ | #no hacer nada si el vpn est.. deshabilitado, | ||
+ | [ ! -f / | ||
+ | |||
+ | |||
+ | # Restart VPNC if both of the specified hosts on the command line are unavailable | ||
+ | if [ $(ping -q -c 3 ${1} 2>&1 | grep "100% packet loss" | sed " | ||
+ | [ $(ping -q -c 3 ${2} 2>&1 | grep "100% packet loss" | sed " | ||
+ | |||
+ | echo Not alive $1 or $2, restarting VPNC | ||
+ | / | ||
+ | # / | ||
+ | sleep 5 | ||
+ | / | ||
+ | else | ||
+ | echo Alive $1 or $2 | ||
fi | fi | ||
</ | </ |
public/recetas/openwrt-tp-link740.1476303652.txt.gz · Última modificación: 2016/10/12 20:20 por boronat