]>
git.proxmox.com Git - ifupdown-pve.git/blob - examples/ping-places.sh
3 if [ `id -u` -ne 0 ] ||
[ "$1" = "" ]; then exit 1; fi
5 if [ -x /usr
/bin
/fping
]; then
14 while read addr pingme scheme
; do
15 if [ "$which" ]; then continue; fi
17 #echo " Trying $addr & $pingme ($scheme)" >&2
19 ip addr add
$addr dev
$iface >/dev
/null
2>&1
20 ip link
set $iface up
>/dev
/null
2>&1
22 if $PING $pingme >/dev
/null
2>&1; then
25 ip link
set $iface down
>/dev
/null
2>&1
26 ip addr del
$addr dev
$iface >/dev
/null
2>&1
29 if [ "$which" ]; then echo $which; exit 0; fi