]> git.pld-linux.org Git - packages/rp-pppoe.git/blame - rp-pppoe-server.init
04dad3c60cf755e0c24e2ea7b39e2bb1 rp-pppoe-enobufs.patch
[packages/rp-pppoe.git] / rp-pppoe-server.init
CommitLineData
744eae05
AM
1#!/bin/sh
2#
3# pppoe-server PPP over Ethernet Server
4#
5# chkconfig: 345 46 54
6#
7# description: PPP over Ethernet Server
8#
9
10# Source function library
11. /etc/rc.d/init.d/functions
12
13# Get network config
14. /etc/sysconfig/network
15
16# Get service config
17[ -f /etc/sysconfig/pppoe-server ] && . /etc/sysconfig/pppoe-server
18
19# Check that networking is up.
20is_no "${NETWORKING}" && exit 0
21
22PPPOE_SERVER_IFACES_OPT=
23if [ -n "$PPPOE_SERVER_IFACES" ]; then
eb2e0f82 24 for iface in $PPPOE_SERVER_IFACES; do
744eae05
AM
25 PPPOE_SERVER_IFACES_OPT="-I $iface $PPPOE_SERVER_IFACES_OPT"
26 done
27fi
28[ -z "$PPPOE_SERVER_AC_NAME" ] && PPPOE_SERVER_AC_NAME="$(hostname -s)"
29[ -z "$PPPOE_SERVER_LOCAL_IP" ] && PPPOE_SERVER_LOCAL_IP="$(hostname -i)"
30[ -z "$PPPOE_SERVER_SERVICE_NAME" ] && PPPOE_SERVER_SERVICE_NAME="PPPoE Server"
31[ -z "$PPPOE_SERVER_MAX_CLIENTS" ] && PPPOE_SERVER_MAX_CLIENTS=64
32
33
34# See how we were called.
35case "$1" in
36 start)
37 # Check if the service is already running?
38 if [ ! -f /var/lock/subsys/pppoe-server ]; then
39 msg_starting "PPPoE Server"
40 modprobe -k pppoe > /dev/null 2>&1
41 for iface in $PPPOE_SERVER_IFACES; do
42 ip link set $iface up 2> /dev/null
43 done
44 daemon /usr/sbin/pppoe-server \
45 ${PPPOE_SERVER_IFACES_OPT:--I eth0} -C $PPPOE_SERVER_AC_NAME \
46 -L $PPPOE_SERVER_LOCAL_IP -S $PPPOE_SERVER_SERVICE_NAME \
47 -N $PPPOE_SERVER_MAX_CLIENTS $PPPOE_SERVER_OPTIONS
48 RETVAL=$?
49 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pppoe-server
50 else
51 msg_already_running "PPPoE Server"
52 fi
53 ;;
54 stop)
55 if [ -f /var/lock/subsys/pppoe-server ]; then
56 msg_stopping "PPPoE Server"
57 killproc pppoe-server
58 rm -f /var/lock/subsys/pppoe-server >/dev/null 2>&1
59 else
60 msg_not_running "PPPoE Server"
61 RETVAL=1
62 fi
63 ;;
64 restart|reload)
65 $0 stop
66 $0 start
67 ;;
68 status)
69 status pppoe-server
70 RETVAL=$?
71 ;;
72 *)
73 msg_usage "$0 {start|stop|init|status|restart|reload}"
74 exit 1
75esac
76
77exit $RETVAL
This page took 0.061823 seconds and 4 git commands to generate.