You could make a little neater job by checking the /var/run/diald.pid unless
you have multiple PPP connections like I have.
PROC=`ps -fp \`echo /var/run/diald.pid\` --no-heading`
this would put a little stress of doing a full `ps -ef` plus the `grep`.
It'll just output the last PID of diald even if it reran again...
You can probably try the -daemon switch to not run in the background and if
it gets to the next line then obviously the program died or something....
thanks,
George Vieira
Network Administrator
Citadel Computer Systems P/L
http://www.citadelcomputer.com.au
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, 4 August 2000 12:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [SLUG] shell scripts
; i'm running ps, grepping to see if a service is running, either stopping
or
; starting the service , then echoing an output
Can you provide more information about what service you're trying verify?
Is it something that is supposed to be running continuously? If so, why
isn't it? Can you perhaps do this more elegantly using && ?
More information please.
--------------------------
script one internet-start
looks to see if diald is running
if it is echo internet is up
else diald start
echo starting internet
script-two internet-check or(sleep 180)
looks to see if diald is running
if it is echo internet is up
else diald stop
echo stopping trying to connect,
(i have had diald connecting successful but then being kicked out because of
whatever reason by the isp, diald maybe will stop after 3 unsuccessful dials
but
in this case will call until the isp fixes it's end, well that's my reason
anyway)
script-three internet-stop
looks to see if diald is running
if it is diald stop
else echo internet is already down
the web page could has a big red icon saying whether diald is running
without
any user action,
i'm running e-smith 4.0, modified red hat
e-smith has authorised users in a group so the page can be password
protected
some perl scripts are in a cgi-bin which allow root access, can i use this
mechanism to run these scripts (or fragments in php)
regards
stephen
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug