1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh while true; do ping -c 1 $1 2>&1 >/dev/null RES=$? if [ "Z$RES" = "Z0" ] ; then echo 'vPing OK' break else echo 'vPing KO' fi sleep 1 done