aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-ppp
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-ppp')
-rwxr-xr-xsysconfig/network-scripts/ifup-ppp71
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