Re: Local clock question with dialup connection
- From: Steve Kostecke <kostecke@xxxxxxxxxxx>
- Date: 24 Apr 2007 01:37:00 GMT
On 2007-04-23, Nigel Henry <cave.dnb@xxxxxxxxxx> 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 <kostecke@xxxxxxxxxxx>
NTP Public Services Project - http://ntp.isc.org/
.
- References:
- Local clock question with dialup connection
- From: Nigel Henry
- Re: Local clock question with dialup connection
- From: Nigel Henry
- Re: Local clock question with dialup connection
- From: Steve Kostecke
- Re: Local clock question with dialup connection
- From: Nigel Henry
- Local clock question with dialup connection
- Prev by Date: Re: Local clock question with dialup connection
- Next by Date: How to measure the synchronization quality?
- Previous by thread: Re: Local clock question with dialup connection
- Next by thread: Re: Local clock question with dialup connection
- Index(es):
Relevant Pages
|