You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-dialup/rp-pppoe/files/rp-pppoe-3.10-gentoo-netscr...

151 lines
5.1 KiB

diff -Nru rp-pppoe-3.10.orig/configs/pppoe.conf rp-pppoe-3.10/configs/pppoe.conf
--- rp-pppoe-3.10.orig/configs/pppoe.conf 2008-06-30 16:00:42.000000000 +0200
+++ rp-pppoe-3.10/configs/pppoe.conf 2008-06-30 22:22:32.000000000 +0200
@@ -21,6 +21,9 @@
# When you configure a variable, DO NOT leave spaces around the "=" sign.
# Ethernet card connected to DSL modem
+#
+# NB: Gentoo overrides ETH when pppoe-start is called from the
+# networking scripts. This setting has no effect in that case.
ETH=eth1
# PPPoE user name. You may have to supply "@provider.com" Sympatico
@@ -86,8 +89,10 @@
# $PIDFILE contains PID of pppoe-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-pppoe.pid"
+#
+# NB: Gentoo overrides PIDFILE when pppoe-start is run from the
+# networking scripts. This setting has no effect in that case.
+PIDFILE="/var/run/rp-pppoe.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 -Nru rp-pppoe-3.10.orig/scripts/pppoe-connect.in rp-pppoe-3.10/scripts/pppoe-connect.in
--- rp-pppoe-3.10.orig/scripts/pppoe-connect.in 2008-06-30 16:00:42.000000000 +0200
+++ rp-pppoe-3.10/scripts/pppoe-connect.in 2008-06-30 22:22:32.000000000 +0200
@@ -62,12 +62,17 @@
;;
esac
-if test ! -f "$CONFIG" -o ! -r "$CONFIG" ; then
+# In Gentoo, CONFIG is a named pipe when pppoe 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
-export CONFIG
-. $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 -Nru rp-pppoe-3.10.orig/scripts/pppoe-start.in rp-pppoe-3.10/scripts/pppoe-start.in
--- rp-pppoe-3.10.orig/scripts/pppoe-start.in 2008-06-30 16:00:42.000000000 +0200
+++ rp-pppoe-3.10/scripts/pppoe-start.in 2008-06-30 22:22:32.000000000 +0200
@@ -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 pppoe 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
-export CONFIG
-. $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@/pppoe-status $CONFIG > /dev/null 2>&1
+ @sbindir@/pppoe-status <(echo "$CONFREAD") >/dev/null 2>&1
# Looks like the interface came up
if [ $? = 0 ] ; then
diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-status rp-pppoe-3.10/scripts/pppoe-status
--- rp-pppoe-3.10.orig/scripts/pppoe-status 2008-06-30 16:00:42.000000000 +0200
+++ rp-pppoe-3.10/scripts/pppoe-status 2008-06-30 22:22:32.000000000 +0200
@@ -28,12 +28,17 @@
;;
esac
-if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
+# In Gentoo, CONFIG is a named pipe when pppoe 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"
diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-stop.in rp-pppoe-3.10/scripts/pppoe-stop.in
--- rp-pppoe-3.10.orig/scripts/pppoe-stop.in 2008-06-30 16:00:42.000000000 +0200
+++ rp-pppoe-3.10/scripts/pppoe-stop.in 2008-06-30 22:22:32.000000000 +0200
@@ -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 pppoe 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
-export CONFIG
-. $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"