aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rp-pppoe/rp-pppoe.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/rp-pppoe/rp-pppoe.initd')
-rw-r--r--testing/rp-pppoe/rp-pppoe.initd41
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/rp-pppoe/rp-pppoe.initd b/testing/rp-pppoe/rp-pppoe.initd
new file mode 100644
index 0000000000..7c5bdf6c09
--- /dev/null
+++ b/testing/rp-pppoe/rp-pppoe.initd
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/pppoe-server
+NAME=pppoe-server
+
+# Setup server and service names, Server peer IP, start of IP range for clients peers, amount of peers at same time
+PARAMS="-C XGT01 -S PPPoEC -L 172.19.${BRNUM}.2 -R 172.19.${BRNUM}.100 -N 100"
+
+test -x /usr/sbin/pppoe-server -a -f /etc/ppp/pppoe-server-options || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting up $NAME "
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON -- $PARAMS
+ echo 1 > /proc/sys/net/ipv4/ip_forward
+ echo "."
+ ;;
+ stop)
+ echo -n "Shutting down $NAME "
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON
+ echo 0 > /proc/sys/net/ipv4/ip_forward
+ killall $DAEMON > /dev/null 2>&1
+ echo "."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $NAME "
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON
+ sleep 1
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON -- $PARAMS
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+