#!/bin/sh PATH=/sbin:/usr/sbin:/bin:/usr/bin # ifup-post for PPP is handled through /etc/ppp/ip-up if [ "$1" != daemon ] ; then # disconnect stdin, out, err to disassociate from controlling tty # so that no HUPs will get through. $0 daemon $*& /dev/null 2>/dev/null exit 0 fi shift cd /etc/sysconfig/network-scripts . network-functions # Get all the settings from the ifcfg-ippp0 or ifcfg-ippp(0-63) # file. # CONFIG=$1 source_config # Setting from ifcfg-ippp0 file # if [ "$2" = "boot" -a "${ONBOOT}" = "no" ]; then exit fi # Check to see if the isdn ipppd binary exists # [ -x /sbin/ipppd ] || { echo "/sbin/pppd does not exist or is not executable" echo "ifup-ppp for $DEVICE exiting" logger -p daemon.info -t ifup-ppp \ "/sbin/pppd does not exist or is not executable for $DEVICE" exit 1 } # Anything I REM'ed out was for pppd (MODEM) specific # opts="lock" if [ "${DEFROUTE}" = yes ] ; then opts="$opts defaultroute" fi if [ -n "${MRU}" ] ; then opts="$opts mru ${MRU}" fi if [ -n "${MTU}" ] ; then opts="$opts mtu ${MTU}" fi if [ -n "${IPADDR}${REMIP}" ] ; then # if either IP address is set, the following will work. opts="$opts ${IPADDR}:${REMIP}" fi if [ -n "${PAPNAME}" ] ; then opts="$opts name ${PAPNAME}" fi #if [ "${DEBUG}" = yes ] ; then # opts="$opts debug" # chatdbg="-v" #fi while : ; do (logger -p daemon.info -t ifup-ippp \ "ipppd started for $DEVICE on ISDN" &)& > /var/run/ippp-$DEVICE.dev /sbin/ipppd -detach $opts \ remotename $DEVICE ipparam $DEVICE \ file /etc/ppp/ioptions # connect "/sbin/isdnctrl dial ippp0" # exit if we're not supposed to persist or our lock file has disappeared # if [ "$PERSIST" != "yes" -o ! -f /var/run/ippp-$DEVICE.dev ]; then # rm -f /var/run/ippp-$DEVICE.dev # exit 0 # fi # dial ippp0 # hangup ippp0 size=`wc -c < /var/run/ippp-$DEVICE.dev` if [ $size = 0 ]; then # ipppd never connected timeout=$RETRYTIMEOUT else # ipppd connected and then disconnected timeout=$DISCONNECTTIMEOUT fi [ -z "$timeout" ] && { timeout=30 } sleep $timeout || { # sleep was killed rm -f /var/run/ippp-$DEVICE.dev exit 0 } # exit if our lock file disappeared while we slept if [ ! -f /var/run/ippp-$DEVICE.dev ]; then exit 0 fi done