From f40053d24d03db47996783f3d33b28e29fbb8e7e Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Fri, 16 Jun 2000 07:26:09 +0000 Subject: sysconfig/network-scripts/ifup-ppp: add hooks for demand-dialing PPP rc.d/init.d/functions: use basename of process when looking for its PID file --- sysconfig/network-scripts/ifup-ppp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'sysconfig/network-scripts') diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp index 2b4b4a8c..9e3a20af 100755 --- a/sysconfig/network-scripts/ifup-ppp +++ b/sysconfig/network-scripts/ifup-ppp @@ -1,20 +1,24 @@ #!/bin/sh PATH=/sbin:/usr/sbin:/bin:/usr/bin +cd /etc/sysconfig/network-scripts +. network-functions + # ifup-post for PPP is handled through /etc/ppp/ip-up if [ "$1" != daemon ] ; then # just in case a full path to the configuration file is passed in - ifcfg=$(basename $1) - shift - # let ppp-watch do the right thing - exec /sbin/ppp-watch "$ifcfg" "$@" + CONFIG=$(basename $1) + [ -f "$CONFIG" ] || CONFIG=ifcfg-$1 + source_config + if [ "$DEMAND" != yes ] ; then + shift + # let ppp-watch do the right thing + exec /sbin/ppp-watch "$ifcfg" "$@" + fi fi shift -cd /etc/sysconfig/network-scripts -. network-functions - CONFIG=$1 [ -f "$CONFIG" ] || CONFIG=ifcfg-$1 source_config @@ -80,6 +84,13 @@ if [ "${DEBUG}" = yes ] ; then opts="$opts debug" chatdbg="-v" fi +if [ ${DEMAND} != yes ] ; then + if [ -n "${IDLETIMEOUT}" ] ; then + opts="$opts demand idle ${IDLETIMEOUT}" + else + opts="$opts demand idle 600" + fi +fi if [ -z "$WVDIALSECT" ] ; then CHATSCRIPT=/etc/sysconfig/network-scripts/chat-$DEVNAME -- cgit v1.2.1