while true
do
sleep 10
ping -c 1 www.google.com &>/dev/null
if [ $? == 0 ];
then
echo "Net available, continuing rc.local..."
break;
else
echo "Net not available, waiting..."
fi
done
Něco je v tom špatně. Nezastaví se to na tom jednom pingu a pinguje to pořád dál...
sudo /usr/local/bin/muj_net_rc.local
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.16) 56(84) bytes of data.
64 bytes from prg02s12-in-f16.1e100.net (173.194.122.16): icmp_seq=1 ttl=57 time=7.28 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.288/7.288/7.288/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.16) 56(84) bytes of data.
64 bytes from prg02s12-in-f16.1e100.net (173.194.122.16): icmp_seq=1 ttl=57 time=7.43 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.435/7.435/7.435/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.16) 56(84) bytes of data.
64 bytes from prg02s12-in-f16.1e100.net (173.194.122.16): icmp_seq=1 ttl=57 time=6.84 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 6.841/6.841/6.841/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.16) 56(84) bytes of data.
64 bytes from prg02s12-in-f16.1e100.net (173.194.122.16): icmp_seq=1 ttl=57 time=6.82 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 6.820/6.820/6.820/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.16) 56(84) bytes of data.
64 bytes from prg02s12-in-f16.1e100.net (173.194.122.16): icmp_seq=1 ttl=57 time=7.29 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.292/7.292/7.292/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.17) 56(84) bytes of data.
64 bytes from prg02s12-in-f17.1e100.net (173.194.122.17): icmp_seq=1 ttl=57 time=7.75 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.750/7.750/7.750/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.17) 56(84) bytes of data.
64 bytes from prg02s12-in-f17.1e100.net (173.194.122.17): icmp_seq=1 ttl=57 time=7.30 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.302/7.302/7.302/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.17) 56(84) bytes of data.
64 bytes from prg02s12-in-f17.1e100.net (173.194.122.17): icmp_seq=1 ttl=57 time=7.78 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.788/7.788/7.788/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.17) 56(84) bytes of data.
64 bytes from prg02s12-in-f17.1e100.net (173.194.122.17): icmp_seq=1 ttl=57 time=7.75 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.758/7.758/7.758/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.17) 56(84) bytes of data.
64 bytes from prg02s12-in-f17.1e100.net (173.194.122.17): icmp_seq=1 ttl=57 time=7.26 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.263/7.263/7.263/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.17) 56(84) bytes of data.
64 bytes from prg02s12-in-f17.1e100.net (173.194.122.17): icmp_seq=1 ttl=57 time=7.04 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.045/7.045/7.045/0.000 ms
/usr/local/bin/muj_net_rc.local: 6: [: 0: unexpected operator
Net not available, waiting...
PING www.google.com (173.194.122.17) 56(84) bytes of data.
64 bytes from prg02s12-in-f17.1e100.net (173.194.122.17): icmp_seq=1 ttl=57 time=7.34 ms
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.348/7.348/7.348/0.000 ms