diff options
author | Jamie Lenehan <lenehan@twibble.org> | 2007-06-07 12:38:46 +0000 |
---|---|---|
committer | Jamie Lenehan <lenehan@twibble.org> | 2007-06-07 12:38:46 +0000 |
commit | 78b39279292a83b35ab2323cf553b002d3c48e2b (patch) | |
tree | a1d0efdf6782937524e51ea1584b78d227c7d69f /packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init | |
parent | 44f91ce2343c5f253248141b3d8f4fd656a33891 (diff) |
rp-pppoe 3.8: More cleanups to the pppoe package:
* Seperate out the server, sniff and relay programs from the main
package.
* Add an init script for the server.
* Add templates to the AC_DEFINE's in the configure script so the
variables are correctly added to the header. Without this the
variables don't get added and server and relay complain about not
being able to be used on linux 2.0 system.
Diffstat (limited to 'packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init')
-rwxr-xr-x | packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init b/packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init new file mode 100755 index 0000000000..21afe0be39 --- /dev/null +++ b/packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init @@ -0,0 +1,59 @@ +#! /bin/sh + +test -f /usr/sbin/pppoe-server || exit 0 +test -f /etc/default/pppoe-server && . /etc/default/pppoe-server + +case $1 in + start) + OPTIONS="" + if [ -n "$MSS" ]; then + OPTIONS="$OPTIONS -m $MSS" + fi + if [ -n "$DEVICES" ]; then + for i in $DEVICES; do + OPTIONS="$OPTIONS -I $i" + done + fi + if [ -n "$LOCAL_IP" ]; then + OPTIONS="$OPTIONS -L $LOCAL_IP" + fi + if [ -n "$REMOTE_IP" ]; then + OPTIONS="$OPTIONS -R $REMOTE_IP" + fi + if [ -n "$SERVICE_NAME" ]; then + OPTIONS="$OPTIONS -S $SERVICE_NAME" + fi + if [ -n "$MAX_SESSIONS" ]; then + OPTIONS="$OPTIONS -N $MAX_SESSIONS" + fi + if [ -n "$ACCESS_CONCENTRATOR_NAME" ]; then + OPTIONS="$OPTIONS -C $ACCESS_CONCENTRATOR_NAME" + fi + echo -n "Starting PPPoE server: pppoe-server" + start-stop-daemon --start --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS + echo "." + ;; + stop) + echo -n "Stopping PPPoE server: pppoe-server" + start-stop-daemon --stop --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS + echo "." + ;; + status) + pid=$(pidof pppoe-server) + if [ -n "$pid" ] ; then + echo "Running with pid $pid" + else + echo "Not running" + fi + ;; + restart|force-reload) + $0 stop + $0 start + ;; + *) + echo "Usage: /etc/init.d/pppoe-server {start|stop|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 |