Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: scripts and the 'at' command
@ 1999-03-28 18:31 James Bremer
  0 siblings, 0 replies; 5+ messages in thread
From: James Bremer @ 1999-03-28 18:31 UTC (permalink / raw)
  To: axp-list

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]


> I have written a short simple script that checks to see if my ppp
> link is up  and if is not, spawns my dialer script.  The last line of
> the script uses the 'at' command to run the script a few minutes
> later.


I wrote a background shell script for my Sun that checks 'ifconfig -a' for
the presence of ppp every five minutes or so, and if it's not there,
restarts it.  The scripting is based on the file locations of the ppp
freeware, so adjust for linux accordingly.

Side note - I'm not sure how your copy of 'wc' might behave.  When I ported
this from SunOS to Solaris, I noticed that 'wc -l' in SunOS will report a
line if there is a null line or a character, whereas in Solaris 'wc -l' will
only report a line if there is an actual character on that line.  Again,
adjust accordingly.

It works fine for me...

James Bremer
tereknor@tereknor.com


[-- Attachment #2: pppcheck --]
[-- Type: application/octet-stream, Size: 632 bytes --]

#!/bin/sh

PPPDIR=/etc/ppp
LOCKDEV=ppp0.pid

x=1
while [ x > 0 ]; do


`ifconfig -a | grep ppp | cut -f 1 -d : > /tmp/out`
if [ `cat /tmp/out | wc -l` = "1" ]; then
	sleep 300
else	

if [ -f /usr/local/bin/pppd ]; then
        if [ -f $PPPDIR/$LOCKDEV ]; then
                rm -f $PPPDIR/$LOCKDEV
        fi
/usr/local/bin/pppd -d call local
        if [ $? = "0" ]; then
                echo "PPP Started..."
                $PPPDIR/ip-up
        else
                echo "Startup failed, see syslog for details"
        fi
else
        echo "pppd not found, exiting..."
        exit 1
fi

	echo `date` > /tmp/pppcrash
fi

done

^ permalink raw reply	[flat|nested] 5+ messages in thread
* scripts and the 'at' command
@ 1999-03-27 15:48 Bob Segrest
  1999-03-27 16:26 ` Rusty Lingenfelter
  1999-03-27 19:39 ` Konrad Podloucky
  0 siblings, 2 replies; 5+ messages in thread
From: Bob Segrest @ 1999-03-27 15:48 UTC (permalink / raw)
  To: axp-list

Greetings,

I have written a short simple script that checks to see if my ppp link is up
and if is not, spawns my dialer script.  The last line of the script uses
the 'at' command to run the script a few minutes later.

The good news is that the script seems to work.  The bad news is that every
time 'at' executes the script it generates a mail message indicating
"warning: command will be executed using /bin/sh".  The first line of my
script is the standard "#!/bin/sh" and I haven't been able to figure out why
this message continues to pop up.  As any output from the script (including
this warning) will cause a mail message to be generated and this could add
up to an excessive number of messages very quickly, I need to fix this
before I can use the script.

Can anyone suggest...

	what I might be doing (or not doing) wrong in my script ???
  or
	how I might suppress mail messages ???

Bob Segrest


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-03-30 18:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-28 18:31 scripts and the 'at' command James Bremer
  -- strict thread matches above, loose matches on Subject: below --
1999-03-27 15:48 Bob Segrest
1999-03-27 16:26 ` Rusty Lingenfelter
1999-03-30 18:40   ` Michael Tibor
1999-03-27 19:39 ` Konrad Podloucky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox