#!/bin/sh 
#
# This file was created when you ran 'ppp -s'.    
#  
# 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.  
#  
# The companion file is /etc/ppp/ip-down, it's run when the ppp connection 
# ends.  
# 
# The environment is cleared before executing this script so the path must 
# be reset. 
# 
export PATH=/usr/sbin:/usr/bin:/sbin:/bin 
export XAUTHORITY=~/.Xauthority

# 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 connect will be reported if your modem 
# reports it.  
#
# You may have to add W2 or S95=1 to your modem init string to get your 
# modem to report the DCE = CARRIER speed.  
# Examples: AT&FW2 or AT&FS95=1  

[ ! -z $DNS1 ] && echo "nameserver $DNS1" > /etc/resolv.conf
[ ! -z $DNS2 ] && echo "nameserver $DNS2" >> /etc/resolv.conf

CS="`grep CONNECT /var/log/report-chat 2>/dev/null | cut -b 24-40 2>/dev/null`"
if (echo "$CS $4 > $5 $1" | xmessage -display :0 -file - 2>/dev/null); then
:  
else  
echo "$CS $4 > $5 $1" > /dev/tty 
fi  

#End!
