Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'These are great' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
These are great
Authored by: Xeo on Feb 03, '02 10:47:52PM

I'm using ip-up for two functions and ip-down for one. ip-up first uses curl to contact my dynamic DNS provider to update my domain with my new IP. The second function is to log the connection time and IP address to a file. The only function of the disconnect is to log the time it was disconnected to the same file.

I found these variables which are passed to ip-up. They make it very easy to log or use the information to get things done.

When the ppp link comes up, this script is called with the following
parameters:
$1 the interface name used by pppd (e.g. ppp3)
$2 the tty device name
$3 the tty device speed
$4 the local IP address for the interface
$5 the remote IP address
$6 the parameter specified by the 'ipparam' option to pppd

If you wanted to log the time and IP to a log file, for example, you could use this line in your script:

echo `date` -- Connected -- IP Address: $4

That's very close to my own line except I formated my date differently than the default.



[ Reply to This | # ]
Problem executing /etc/ppp/ip-up
Authored by: schroeder64 on Sep 15, '02 10:22:05AM

I created the ip-up shell script with execute permission, but pppd is giving me the following error:

Sep 15 09:52:22 pppd[828]: Can't execute /etc/ppp/ip-up: Exec format error

It seemed that it was expecting a binary program instead of script. To test it out I tried to link /bin/ls to /etc/ppp/ip-up, and pppd didn't show an error.

I did this on 10.2.



[ Reply to This | # ]