I'm trying to write either a perl script or shell script to restart
natd after an html script adds to the natd.conf file.  The problem
I've run into is after the script kills the natd process, it has to
quess how long to wait before it restarts it.  Here's how I'm doing
it now:

##Restart NATD
print `kill \`cat /var/run/natd.pid\``;
sleep (20);
print `/sbin/natd -f /etc/natd.conf`;

I need to run a loop that continuously checks for natd to be killed
before it tries to run again.  Since I'm doing all this remotely it
causes major problems if the timing is off and it tries to restart
but can't.  What would be ideal is if it even checks after the
restart it checks one more time to see if it fails.  If it fails it
could start up with a default backup natd.conf.backup file.

kill \`cat /var/run/natd.pid\`
while true
if [ -z $(ps -ef |grep natd | grep -v grep) ] ; then
    /sbin/natd -f /etc/natd.conf

Help completing this script would be great.  Thanks in advance!


Webmail Provided by Lock-Net Internet Services: www.lock-net.com

[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to