Commit 2f3a2d33 authored by Francesco Colista's avatar Francesco Colista Committed by Natanael Copa
Browse files

testing/rp-pppoe: use runscript' as first line in

parent 2110fabe
......@@ -2,7 +2,7 @@
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=rp-pppoe
pkgver=3.10
pkgrel=1
pkgrel=2
pkgdesc="Roaring Penguin\'s Point-to-Point Protocol over Ethernet client"
url="http://www.roaringpenguin.com/pppoe/"
arch="x86 x86_64"
......
#!/bin/sh
#
#!/sbin/runscript
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/pppoe-server
NAME=pppoe-server
depend() {
need net
}
# 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"
start() {
ebegin "Starting PPPOE Server"
test -x /usr/sbin/pppoe-server -a -f /etc/ppp/pppoe-server-options || exit 0
start-stop-daemon --start --exec /usr/sbin/pppoe-server -- ${PPPOE_PARAMS}
echo 1 > /proc/sys/net/ipv4/ip_forward
eend $?
}
test -x /usr/sbin/pppoe-server -a -f /etc/ppp/pppoe-server-options || exit 0
stop () {
ebegin "Stopping PPPOE Server"
start-stop-daemon --stop --exec /usr/sbin/pppoe-server
echo 0 > /proc/sys/net/ipv4/ip_forward
eend $?
}
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
restart () {
ebegin "Restarting PPPOE Server"
start-stop-daemon --stop --exec /usr/sbin/pppoe-server
sleep 1
start-stop-daemon --start --quiet --pidfile /var/run/$NAME/$NAME.pid --exec $DAEMON -- $PARAMS
start-stop-daemon --start --exec /usr/sbin/pppoe-server -- ${PPPOE_PARAMS}
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "."
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment