On Fri, 25 Dec 1998, JOSE NG LEE wrote:
>
> I am using linux slackware installation and connect to the internet
> with a ppp dial-up dynamic IP connection. I setup my linux to dial
> and reconnect automatically to my ISP everytime the connection drops.
>
> Since my IP address is dynamic, I am using one of those domain
> naming service so that I can have my linux computer running at home
> and telnet access it at my office with a domain name. On my ppp-on
> script, I included a line to execute a file to update my current
> IP address at the domain naming service.
>
> The problem I am having is when my internet connection drops and
> ppp-on starts to reconnect, it executes inmediately the line to
> update my current IP address before ppp have not yet finished
> establishing the connection. So, my current IP adddress is not
> updated because ppp connection has not been established yet.
>
> Can someone help me with a script or supply me with a script to
> detect first when my ppp connection is up and working for then to
> execute the line to update my current IP address.
>
> JOSE / HP2CWB
>
Hello Jose,
Here is a script that I use to detect if the ppp0 is up. Perhaps you can
edit it for your application. Also, may be well to add a 'sleep n' before
the line to update your current IP address.
#! /bin/sh
# ppp-test, w0plw 4-26-98
# If there's no /var/run/ppp0.pid file, ISP connection has dropped.
# Start re-dial process.
# Run from crontab as root every 5 minutes.
if [ ! -r /var/run/ppp0.pid ]; then
echo "Yikes! It ain't there"
ppp-on
fi
# End of ppp-test.
The [ ! -r ... checks to see if the file is NOT there. To check to see if
the file IS there, just remove the '!'. You may try something like:
sleep 10
if [ -r /var/run/ppp0.pid ]; then
echo "Starting IP Update"
ip_update_command
fi
--
73, Ronnie.
[EMAIL PROTECTED]