On 2007-04-23, Nigel Henry <[EMAIL PROTECTED]> wrote:
> On Monday 23 April 2007 22:20, Steve Kostecke wrote:
>
>> #!/bin/sh
>>
>> # The hostname or IP address of the host that you want to ping.
>> TARGET=
>>
>> while [ 1 ]

Start an infinite loop consisting of the statements between the 'do' and
'done'.

>> do
>>   /bin/ping -c 4 $TARGET 2>/dev/null >/dev/null && break

&& is a command operator which denotes an AND list. An AND list has the
form:

        command1 && command2

command2 is executed if, and only if, command1 returns an exit status of
zero. 'man bash' for more information.

So, in the line quoted above ...

Ping the $TARGET 4 times throwing away all output. Break out of the loop
if the ping is successful. Otherwise continue to the next step.

>>   /bin/sleep 60
>>
>> done
>>
>> /usr/local/bin/ntp-restart

The ntp-restart line is the only thing left to execute after breaking
out of the loop.

-- 
Steve Kostecke <[EMAIL PROTECTED]>
NTP Public Services Project - http://ntp.isc.org/

_______________________________________________
questions mailing list
[email protected]
https://lists.ntp.isc.org/mailman/listinfo/questions

Reply via email to