Re: Local clock question with dialup connection



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/
.



Relevant Pages

  • Re: help with pipe
    ... I think because the command ping never finishes (ping is an example ... Yes, of course, if ping never finishes, why should the loop ... the spawned process is what open returns). ...
    (comp.lang.perl.misc)
  • Re: help with pipe
    ... I think because the command ping never finishes (ping is an example ... $cmd never terminates, therefore ZAP is ... and use that as the termination condition for the loop. ...
    (comp.lang.perl.misc)
  • RE: ICMP (Ping)
    ... No determining a target based upon hatred or zero day exploits. ... As far as the ping sweep stuff, to be honest, I wouldn't ever have ... How you assume they will attack the network or probe ... Almost all scanners and worms even, will hit the range of IPs and not ...
    (Security-Basics)
  • Re: Cannot simultaneously share DSL connection
    ... Did you typed the ID and PW of the Internet provider into the WAN DSL ... Computer 2: Nancy ... Target Nancy ... "DIANNE ping Nancy" ...
    (microsoft.public.windowsxp.network_web)
  • Re: PRB:socket api "listen" always fails returning WSAEINVAL and p
    ... Is the target device running the Windows CE firewall? ... to do with the ping situation, but what you're doing there is wrong. ... port issue on emulator in wince 6.0.Can you give some idea to that too?I ... int listener; ...
    (microsoft.public.windowsce.app.development)