> I've serched www and redhat's homepage, but I cannot figure out how to
> display my PPP connection speed when using netcfg (or rather the scripts
> generated by netcfg) to connect to my isp. Off course when i dial my isp
> manually i can see the CONNECT 33600, or whatever the connection speed
> is, but I cannot get any debug information from the netcfg scripts.
> I would like to have my ip-adress and connection speed displayed
> everytime I dial my isp. I'm pretty sure that pppd or some other program
> writes this information to some kind of log file, which could then be
> displayed, but perhaps i need to add a debug option somwhere in the
> scripts.
> Please mail me if you have any ideas, I'm using Redhat 5.0
> Thanks
> Kasper Laudrup
When pppd has a successful connection it runs the /etc/ppp/ip-up script.
You can put the ip-up script below in /etc/ppp, it will print the
local IP and remote IP address to the screen when you have a
successful ppp connection.
~# chmod 755 /etc/ppp/ip-up
#!/bin/sh
#
# This file /etc/ppp/ip-up is run by pppd when there's a
# successful ppp connection.
#
# Put any commands you want run after a successful connection
# in this file.
#
# Any commands you want printed to the screen should be directed
# to: >/dev/console
#
# Other commands should not be directed to: >/dev/console
#
PATH=/usr/bin:/usr/sbin:/usr/local/bin:/sbin:/bin
export PATH
# This will print to the screen the local & remote IP address when you
# make a successful ppp connection. $4 = Local IP $5 = Remote IP
#
# The CARRIER speed at which you connected will be reported, if it's in
# the /var/log/messages file. You also need the programs "tail" "cut"
# "tr" and "grep" for this to work.
echo "* YES! PPP connected. *" >/dev/console
if [ -s /var/log/messages ]; then
S=`tail -n 30 /var/log/messages 2>/dev/null | grep "CARRIER" 2>/dev/null | tr -d "^M)" 2>/dev/null | cut -dR -f4 2>/dev/null`
if [ ! "$S" = "" ]; then
echo "$S <SPEED> Local IP: $4 -> Remote IP: $5" >/dev/console
else
echo "Local IP: $4 -> Remote IP: $5" >/dev/console
fi
fi
# If you want sendmail to send any mail in /var/spool/mqueue when
# you connect, remove the # below.
#sendmail -q
# If you want fetchmail to get your mail when you connect and check
# every 300 seconds = 5 minutes for mail, remove the # below.
#fetchmail -d 300
# End...
--
http://www.tux.org/pub/people/kent-robotti/doslinux/index.html
ftp://ftp.tux.org/pub/people/kent-robotti "pppsetup-1.84.tar.gz"
PPPsetup is a bash shell script for creating a chat script
to make a ppp connection.