diff options
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-x | sysconfig/network-scripts/ifdown-ppp | 25 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-ppp | 12 |
2 files changed, 25 insertions, 12 deletions
diff --git a/sysconfig/network-scripts/ifdown-ppp b/sysconfig/network-scripts/ifdown-ppp index 3265c72d..282c22b0 100755 --- a/sysconfig/network-scripts/ifdown-ppp +++ b/sysconfig/network-scripts/ifdown-ppp @@ -7,7 +7,18 @@ cd /etc/sysconfig/network-scripts CONFIG=$1 source_config -file=/var/run/pppwatch-$DEVICE.pid +if [ "${DEMAND}" != no -a -f /var/run/ppp-${DEVICE}.pid ] ; then + PID=`head -1 /var/run/ppp-${DEVICE}.pid` + kill -TERM ${PID} + sleep 2 + [ ! -d /proc/${PID} ] && exit 0 + kill -TERM ${PID} + sleep 2 + [ ! -d /proc/${PID} ] && exit 0 + exit 1 +fi + +file=/var/run/pppwatch-${DEVICE}.pid if [ ! -f $file ]; then # ppp isn't running, or we didn't start it @@ -15,17 +26,17 @@ if [ ! -f $file ]; then fi PID=`cat $file` -[ -n "$PID" ] || exit 1 +[ -n "${PID}" ] || exit 1 -kill -TERM $PID > /dev/null 2>&1 -[ ! -d /proc/$PID ] && exit 0 +kill -TERM ${PID} > /dev/null 2>&1 +[ ! -d /proc/${PID} ] && exit 0 sleep 2 -[ ! -d /proc/$PID ] && exit 0 +[ ! -d /proc/${PID} ] && exit 0 # killing ppp-watch twice in a row causes it to send a SIGKILL to pppd pgrp -kill -TERM $PID > /dev/null 2>&1 +kill -TERM ${PID} > /dev/null 2>&1 # ip-down won't run in this case /etc/sysconfig/network-scripts/ifdown-post $1 -[ ! -d /proc/$PID ] && exit 0 +[ ! -d /proc/${PID} ] && exit 0 exit 1 diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp index a8a3f7d6..d672f72e 100755 --- a/sysconfig/network-scripts/ifup-ppp +++ b/sysconfig/network-scripts/ifup-ppp @@ -6,7 +6,7 @@ cd /etc/sysconfig/network-scripts # ifup-post for PPP is handled through /etc/ppp/ip-up -if [ "$1" = daemon ] ; then +if [ "${1}" = daemon ] ; then # we've been called from ppp-watch, so don't invoke it for persistence shift else @@ -21,8 +21,8 @@ else fi fi -CONFIG=${1} -[ -f "${CONFIG}" ] || CONFIG=ifcfg-$1 +CONFIG=$1 +[ -f "${CONFIG}" ] || CONFIG=ifcfg-${1} source_config if [ -z "${DISCONNECTTIMEOUT}" ]; then @@ -92,6 +92,8 @@ if [ ${DEMAND} = yes ] ; then else opts="$opts demand idle 600" fi +else + opts="$opts updetach" fi if [ -z "${WVDIALSECT}" ] ; then @@ -107,13 +109,13 @@ fi "pppd started for ${DEVICE} on ${MODEMPORT} at ${LINESPEED}" &)& if [ -n "${WVDIALSECT}" ] ; then - exec /usr/sbin/pppd -detach $opts ${MODEMPORT} ${LINESPEED} \ + exec /usr/sbin/pppd $opts ${MODEMPORT} ${LINESPEED} \ ipparam ${DEVICE} linkname ${DEVICE} \ noauth \ ${PPPOPTIONS} \ connect "/usr/bin/wvdial --remotename ${DEVICE} --chat ${WVDIALSECT}" else - exec /usr/sbin/pppd -detach $opts ${MODEMPORT} ${LINESPEED} \ + exec /usr/sbin/pppd $opts ${MODEMPORT} ${LINESPEED} \ ipparam ${DEVICE} linkname ${DEVICE} \ noauth \ ${PPPOPTIONS} \ |