diff options
author | Michael K. Johnson <johnsonm@redhat.com> | 1999-09-07 01:48:59 +0000 |
---|---|---|
committer | Michael K. Johnson <johnsonm@redhat.com> | 1999-09-07 01:48:59 +0000 |
commit | 9488c4cdd6895c00ca4e521473f488955d45a308 (patch) | |
tree | aef8be5163d91f42bd39eef1551018cacec1f29f /sysconfig/network-scripts/ifup-ppp | |
parent | 57487e296e885786382588f547d259bec4c3595e (diff) | |
download | initscripts-9488c4cdd6895c00ca4e521473f488955d45a308.tar initscripts-9488c4cdd6895c00ca4e521473f488955d45a308.tar.gz initscripts-9488c4cdd6895c00ca4e521473f488955d45a308.tar.bz2 initscripts-9488c4cdd6895c00ca4e521473f488955d45a308.tar.xz initscripts-9488c4cdd6895c00ca4e521473f488955d45a308.zip |
first attempt at integrating ppp-watch
Diffstat (limited to 'sysconfig/network-scripts/ifup-ppp')
-rwxr-xr-x | sysconfig/network-scripts/ifup-ppp | 71 |
1 files changed, 17 insertions, 54 deletions
diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp index 3fd810f7..d058e9b3 100755 --- a/sysconfig/network-scripts/ifup-ppp +++ b/sysconfig/network-scripts/ifup-ppp @@ -4,10 +4,8 @@ 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 >/dev/null 2>/dev/null & - exit 0 + # let ppp-watch do the right thing + exec /sbin/ppp-watch "$@" fi shift @@ -87,54 +85,19 @@ else CHATSCRIPT= fi -while : ; do - (logger -p daemon.info -t ifup-ppp \ - "pppd started for $DEVICE on $MODEMPORT at $LINESPEED" &)& +(logger -p daemon.info -t ifup-ppp \ + "pppd started for $DEVICE on $MODEMPORT at $LINESPEED" &)& - if [ -n "$WVDIALSECT" ] ; then - /usr/sbin/pppd -detach $opts $MODEMPORT $LINESPEED \ - remotename $DEVICE ipparam $DEVICE \ - ${PPPOPTIONS} \ - linkname $DEVICE \ - connect "/usr/bin/wvdial --chat $WVDIALSECT" - else - /usr/sbin/pppd -detach $opts $MODEMPORT $LINESPEED \ - remotename $DEVICE ipparam $DEVICE \ - ${PPPOPTIONS} \ - linkname $DEVICE \ - connect "/usr/sbin/chat $chatdbg -f $CHATSCRIPT" - fi - - # exit if we're not supposed to persist or our lock file has disappeared - if [ "$PERSIST" != "yes" -o ! -f /var/run/ppp-$DEVICE.dev ]; then - rm -f /var/run/ppp-$DEVICE.dev - exit 0 - fi - - size=`wc -c < /var/run/ppp-$DEVICE.dev` - - if [ $size = 0 ]; then - # pppd never connected - timeout=$RETRYTIMEOUT - else - # pppd connected and then disconnected - timeout=$DISCONNECTTIMEOUT - fi - - [ -z "$timeout" ] && { - timeout=30 - } - - sleep $timeout || { - # sleep was killed - rm -f /var/run/ppp-$DEVICE.dev - rm -f /var/run/ppp-$DEVICE.pid - exit 0 - } - - # exit if our lock file disappeared while we slept - if [ ! -f /var/run/ppp-$DEVICE.dev ]; then - rm -f /var/run/ppp-$DEVICE.pid - exit 0 - fi -done +if [ -n "$WVDIALSECT" ] ; then + exec /usr/sbin/pppd -detach $opts $MODEMPORT $LINESPEED \ + remotename $DEVICE ipparam $DEVICE \ + ${PPPOPTIONS} \ + linkname $DEVICE \ + connect "/usr/bin/wvdial --chat $WVDIALSECT" +else + exec /usr/sbin/pppd -detach $opts $MODEMPORT $LINESPEED \ + remotename $DEVICE ipparam $DEVICE \ + ${PPPOPTIONS} \ + linkname $DEVICE \ + connect "/usr/sbin/chat $chatdbg -f $CHATSCRIPT" +fi |