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 --- initscripts.spec | 6 +++++- sysconfig.txt | 5 +++++ sysconfig/network-scripts/ifup-ppp | 25 ++++++++++++++++++------- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/initscripts.spec b/initscripts.spec index ff3e943e..d3d7cce9 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -1,6 +1,6 @@ Summary: The inittab file and the /etc/init.d scripts. Name: initscripts -Version: 5.18 +Version: 5.19 Copyright: GPL Group: System Environment/Base Release: 1 @@ -223,6 +223,10 @@ rm -rf $RPM_BUILD_ROOT %ghost %attr(0664,root,utmp) /var/run/utmp %changelog +* Fri Jun 16 2000 Nalin Dahyabhai +- ifup-ppp: add hooks for demand-dialing PPP +- functions: use basename of process when looking for its PID file + * Thu Jun 15 2000 Bill Nottingham - move from /etc/rc.d/init.d -> /etc/init.d diff --git a/sysconfig.txt b/sysconfig.txt index 9a744407..89c64831 100644 --- a/sysconfig.txt +++ b/sysconfig.txt @@ -317,6 +317,11 @@ Files in /etc/sysconfig/network-scripts/ GATEWAY= ONBOOT=yes|no USERCTL=yes|no + DEMAND=yes|no + Only used for PPP. Switches on demand-dialing mode. + IDLETIMEOUT=600 + Only used for PPP. The amount of time the link needs to be inactive + before pppd will bring it down automatically. BOOTPROTO=none|bootp|dhcp MTU= PEERDNS=yes|no 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