#----------------------------------------------------------------------------
#!/bin/sh
#
# FILE	- /etc/ppp/ip-up.local
#
# This script is run by the pppd after the link is established.
# It should be used to add routes, set IP address, run the mailq 
# etc.
#
# The script is called with the following arguments:
#    Arg  Name               Example
#    $1   Interface name     ppp0
#    $2   The tty            ttyS1
#    $3   The link speed     38400
#    $4   Local IP number    12.34.56.78
#    $5   Peer  IP number    12.34.56.99
#
# The  environment is cleared before executing this script
# so the path must be reset:
	PATH=/usr/sbin:/sbin:/usr/bin:/bin
	export PATH
#
# Export IP for quick reference
	echo $4 > /etc/ipaddress; chmod 755 /etc/ipaddress
#
# Create a keep-alive ping to maintain connection
	ping www.domain.com >/dev/null &
exit 0


#----------------------------------------------------------------------------
#!/bin/sh
#
# FILE	- /etc/ppp/ip-down.local
#
# This script is called when the ppp link is disconnected.
#
killall ping
if [ -f /etc/ipaddress ]; then
	/bin/rm /etc/ipaddress
fi
exit 0