* 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
* Re: scripts and the 'at' command
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
1 sibling, 1 reply; 5+ messages in thread
From: Rusty Lingenfelter @ 1999-03-27 16:26 UTC (permalink / raw)
To: axp-list
Bob Segrest wrote:
> 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
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
Bob,
Your script sounds interesting. I am going to use a Linux box (either my Multia
or my Sparc) as a gateway to my ISP. I will be using a 56K modem, so I was
thinking about how I would allow the others on the LAN to light up PPP remotely
(very easily since it is my wife and kids). It sounds like a script like yours
would be good, then they would not have to holler up the stairs to see if I was
already on. When you have a minute, I would appreciate some insight into how
you are using it. Thanks.
Rusty
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: 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
1 sibling, 0 replies; 5+ messages in thread
From: Konrad Podloucky @ 1999-03-27 19:39 UTC (permalink / raw)
To: Bob Segrest; +Cc: axp-list
On 27-Mar-99 Bob Segrest wrote:
> 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.
>
[...]
Why don't you create a cron job to execute your script periodically?
That way you could avoid using 'at'.
Konrad
______________________________________________________________________
Konrad Podloucky <konrad@pelimbert.tssc.univie.ac.at>
Vienna, Austria PGP-key available by request
Running LINUX on an Alpha
"Windows 9x: n. 32 bit extensions and a graphical shell for a 16 bit
patch to an 8 bit operating system originally coded for a 4 bit
microprocessor, written by a 2 bit company that can't stand 1 bit
of competition."
--Cygnus CygWin (aka GNU/Win32) FAQ
^ permalink raw reply [flat|nested] 5+ messages in thread
* 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
* Re: scripts and the 'at' command
1999-03-27 16:26 ` Rusty Lingenfelter
@ 1999-03-30 18:40 ` Michael Tibor
0 siblings, 0 replies; 5+ messages in thread
From: Michael Tibor @ 1999-03-30 18:40 UTC (permalink / raw)
To: axp-list
On Sat, 27 Mar 1999, Rusty Lingenfelter wrote:
> Bob,
>
> Your script sounds interesting. I am going to use a Linux box (either my Multia
> or my Sparc) as a gateway to my ISP. I will be using a 56K modem, so I was
> thinking about how I would allow the others on the LAN to light up PPP remotely
> (very easily since it is my wife and kids). It sounds like a script like yours
> would be good, then they would not have to holler up the stairs to see if I was
> already on. When you have a minute, I would appreciate some insight into how
> you are using it. Thanks.
>
> Rusty
Have you looked at the IPMASQ Dialer (or something like that)? You should
be able to find it at freshmeat.net. What I think makes it interesting is
that it consists of a daemon running on the gateway, and a win32 client
program which can be run on a Windows box in order to bring up/shut down
the ppp link.
I haven't tried it (I'm on a cable modem now), but if I have to go back to
dialup ppp I would definitely look at it.
Mike
--
Mike Tibor Univ. of Alaska Anchorage (907) 786-1001 voice
LAN Technician Consortium Library (907) 786-6050 fax
tibor@lib.uaa.alaska.edu http://www.lib.uaa.alaska.edu/~tibor/
http://www.lib.uaa.alaska.edu/~tibor/pgpkey for PGP public key
^ 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