On Wednesday 2004 May 05 23:43, Ed wrote:
> Is there a simple perl sript that can monitor squid process, I can't find
> one on google pls help....Im not too familiar with perl scripting....by the
> way here's the condition.
> 1.) looking for the squid process (like "ps aux | grep squid" commnand in
> unix)
> 2.) If there is squid process, nothing to be done then exit.
> 3.) If there's no squid process, simply start squid service and exit.
No need for Perl for this one, here's the bash script, it's not yet efficient,
but this is what i thought of first:
----
#!/bin/sh
if [ ! "`ps aux | grep squid`" ]; do
<COMMAND TO START SQUID>
done
----
And that's it!
If you insist on making making a Perl script:
----
#!/usr/bin/perl
unless ("`ps aux | grep squid`") {
`<COMMAND TO START SQUID>`
}
----
hehe.
HTH.
Will you be needing this to run with something? just say so... if not, that
should work.
--
eman calso
http://www.bloodpet.tk/
Go placidly amid the noise and waste, and remember what value there may
be in owning a piece thereof.
-- National Lampoon, "Deteriorata"
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie