Re: Attn: Scripting wizards

From: Michele Andreoli (m.andreoli@tin.it)
Date: Mon Sep 04 2000 - 12:32:24 CEST


On Mon, Sep 04, 2000 at 10:19:42AM +0200, Bill nicely wrote:
>
> I'm trying to write a basic script that will ping a host for a specific time
> frame
> and with user set intervals and pipe the output to a file... something like
>
> myping [host] [duration minutes] [interval seconds] [output - path and file
> name]
>

I used "nc" for that, not "ping", because it do not interrupt is link
is down. If your goal is to discover if a host is up you can use that:

rustic_ping()
{
timeout=1; port=1
nc -zv -w $timeout $1 $port 2>&1
return $?
}

The "-w" command is the timeout (1 sec in this example).

Michele

-- 
I'd like to conclude with a positive statement, but I can't 
remember any. Would two negative ones do?       -- Woody Allen
---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk


This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:15 CET