diff -Naur rp-pppoe-3.5/configs/pppoe.conf rp-pppoe-3.5.patched/configs/pppoe.conf --- rp-pppoe-3.5/configs/pppoe.conf 2002-07-08 16:38:24.000000000 +0200 +++ rp-pppoe-3.5.patched/configs/pppoe.conf 2004-10-31 20:59:11.716686192 +0100 @@ -21,6 +21,9 @@ # When you configure a variable, DO NOT leave spaces around the "=" sign. # Ethernet card connected to ADSL modem +# +# NB: Gentoo overrides ETH when adsl-start is called from the +# networking scripts. This setting has no effect in that case. ETH=eth1 # ADSL user name. You may have to supply "@provider.com" Sympatico @@ -86,8 +89,10 @@ # $PIDFILE contains PID of adsl-connect script # $PIDFILE.pppoe contains PID of pppoe process # $PIDFILE.pppd contains PID of pppd process -CF_BASE=`basename $CONFIG` -PIDFILE="/var/run/$CF_BASE-adsl.pid" +# +# NB: Gentoo overrides PIDFILE when adsl-start is run from the +# networking scripts. This setting has no effect in that case. +PIDFILE="/var/run/adsl.pid" # Do you want to use synchronous PPP? "yes" or "no". "yes" is much # easier on CPU usage, but may not work for you. It is safer to use diff -Naur rp-pppoe-3.5/scripts/adsl-connect.in rp-pppoe-3.5.patched/scripts/adsl-connect.in --- rp-pppoe-3.5/scripts/adsl-connect.in 2002-07-08 16:38:24.000000000 +0200 +++ rp-pppoe-3.5.patched/scripts/adsl-connect.in 2004-10-31 17:57:26.934465072 +0100 @@ -62,12 +62,18 @@ ;; esac -if test ! -f "$CONFIG" -o ! -r "$CONFIG" ; then +# In Gentoo, CONFIG is a named pipe when adsl is started by the +# network scripts. Testing -r is allowed; testing -f is not. +if test ! -r "$CONFIG" ; then echo "$0: Cannot read configuration file '$CONFIG'" >& 2 exit 1 fi -. $CONFIG + +# Read the named pipe (/dev/fd/foo) into a variable so we can use it +# again later (since reading once from the pipe will exhaust it) +CONFREAD=$(<$CONFIG) +eval "$CONFREAD" PPPOE_PIDFILE="$PIDFILE.pppoe" PPPD_PIDFILE="$PIDFILE.pppd" diff -Naur rp-pppoe-3.5/scripts/adsl-start.in rp-pppoe-3.5.patched/scripts/adsl-start.in --- rp-pppoe-3.5/scripts/adsl-start.in 2002-07-08 16:38:24.000000000 +0200 +++ rp-pppoe-3.5.patched/scripts/adsl-start.in 2004-10-31 17:56:18.546861568 +0100 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # @configure_input@ #*********************************************************************** # @@ -113,12 +113,17 @@ ;; esac -if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then +# In Gentoo, CONFIG is a named pipe when adsl is started by the +# network scripts. Testing -r is allowed; testing -f is not. +if [ ! -r "$CONFIG" ] ; then $ECHO "$ME: Cannot read configuration file '$CONFIG'" >& 2 exit 1 fi -. $CONFIG +# Read the named pipe (/dev/fd/foo) into a variable so we can use it +# again later (since reading once from the pipe will exhaust it) +CONFREAD=$(<$CONFIG) +eval "$CONFREAD" # Check for command-line overriding of ETH and USER case "$#" in @@ -145,11 +150,11 @@ # Start the connection in the background unless we're debugging if [ "$DEBUG" != "" ] ; then - $CONNECT "$@" + $CONNECT <(echo "$CONFREAD") exit 0 fi -$CONNECT "$@" > /dev/null 2>&1 & +$CONNECT <(echo "$CONFREAD") >/dev/null 2>&1 & CONNECT_PID=$! if [ "$CONNECT_TIMEOUT" = "" -o "$CONNECT_TIMEOUT" = 0 ] ; then @@ -164,7 +169,7 @@ # Monitor connection TIME=0 while [ true ] ; do - @sbindir@/adsl-status $CONFIG > /dev/null 2>&1 + @sbindir@/adsl-status <(echo "$CONFREAD") >/dev/null 2>&1 # Looks like the interface came up if [ $? = 0 ] ; then diff -Naur rp-pppoe-3.5/scripts/adsl-status rp-pppoe-3.5.patched/scripts/adsl-status --- rp-pppoe-3.5/scripts/adsl-status 2002-07-08 16:38:24.000000000 +0200 +++ rp-pppoe-3.5.patched/scripts/adsl-status 2004-10-31 17:59:41.785964528 +0100 @@ -28,12 +28,17 @@ ;; esac -if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then +# In Gentoo, CONFIG is a named pipe when adsl is started by the +# network scripts. Testing -r is allowed; testing -f is not. +if [ ! -r "$CONFIG" ] ; then echo "$0: Cannot read configuration file '$CONFIG'" >& 2 exit 1 fi -. $CONFIG +# Read the named pipe (/dev/fd/foo) into a variable so we can use it +# again later (since reading once from the pipe will exhaust it) +CONFREAD=$(<$CONFIG) +eval "$CONFREAD" PPPOE_PIDFILE="$PIDFILE.pppoe" PPPD_PIDFILE="$PIDFILE.pppd" @@ -81,4 +86,4 @@ echo "adsl-status: Link is down -- could not find interface corresponding to" echo "pppd pid $PPPD_PID" -exit 1 \ No newline at end of file +exit 1 diff -Naur rp-pppoe-3.5/scripts/adsl-stop.in rp-pppoe-3.5.patched/scripts/adsl-stop.in --- rp-pppoe-3.5/scripts/adsl-stop.in 2002-07-08 16:38:24.000000000 +0200 +++ rp-pppoe-3.5.patched/scripts/adsl-stop.in 2004-10-31 18:00:07.958985624 +0100 @@ -31,12 +31,17 @@ CONFIG=/etc/ppp/pppoe.conf fi -if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then +# In Gentoo, CONFIG is a named pipe when adsl is started by the +# network scripts. Testing -r is allowed; testing -f is not. +if [ ! -r "$CONFIG" ] ; then echo "$ME: Cannot read configuration file '$CONFIG'" >& 2 exit 1 fi -. $CONFIG +# Read the named pipe (/dev/fd/foo) into a variable so we can use it +# again later (since reading once from the pipe will exhaust it) +CONFREAD=$(<$CONFIG) +eval "$CONFREAD" PPPOE_PIDFILE="$PIDFILE.pppoe" PPPD_PIDFILE="$PIDFILE.pppd"