3 # pppoe-relay PPP over Ethernet Relay Server
7 # description: PPP over Ethernet Relay Server
10 # Source function library
11 . /etc/rc.d/init.d/functions
14 . /etc/sysconfig/network
17 [ -f /etc/sysconfig/pppoe-relay ] && . /etc/sysconfig/pppoe-relay
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22 msg_network_down "PPPoE Relay Server"
29 PPPOE_RELAY_IFACES_SERVERS_OPT=
30 for iface in $PPPOE_RELAY_IFACES_SERVERS; do
31 PPPOE_RELAY_IFACES_SERVERS_OPT="-S $iface $$PPPOE_RELAY_IFACES_SERVERS"
34 PPPOE_RELAY_IFACES_CLIENTS=
35 for iface in $PPPOE_RELAY_IFACES_CLIENTS; do
36 PPPOE_RELAY_IFACES_CLIENTS_OPT="-C $iface $PPPOE_RELAY_IFACES_CLIENTS"
38 PPPOE_RELAY_IFACES_BOTH=
39 for iface in $PPPOE_RELAY_IFACES_BOTH; do
40 PPPOE_RELAY_IFACES_BOTH_OPT="-B $iface $PPPOE_RELAY_IFACES_BOTH"
43 [ -z "$PPPOE_RELAY_MAX_SESSIONS" ] && PPPOE_RELAY_MAX_SESSIONS=500
44 [ -z "$PPPOE_RELAY_TIMEOUT" ] && PPPOE_RELAY_TIMEOUT=600
47 # See how we were called.
50 # Check if the service is already running?
51 if [ ! -f /var/lock/subsys/pppoe-relay ]; then
52 msg_starting "PPPoE Relay Server"
53 for iface in $PPPOE_RELAY_IFACES_SERVERS $PPPOE_RELAY_IFACES_CLIENTS $PPPOE_RELAY_IFACES_BOTH; do
54 ip link set $iface up 2> /dev/null
56 daemon /usr/sbin/pppoe-relay \
57 $PPPOE_RELAY_IFACES_SERVERS_OPT \
58 $PPPOE_RELAY_IFACES_CLIENTS_OPT \
59 $PPPOE_RELAY_IFACES_BOTH_OPT \
60 -n $PPPOE_RELAY_MAX_SESSIONS -i $PPPOE_RELAY_TIMEOUT
62 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pppoe-relay
64 msg_already_running "PPPoE Relay Server"
68 if [ -f /var/lock/subsys/pppoe-relay ]; then
69 msg_stopping "PPPoE Relay Server"
71 rm -f /var/lock/subsys/pppoe-relay >/dev/null 2>&1
73 msg_not_running "PPPoE Relay Server"
86 msg_usage "$0 {start|stop|restart|force-reload|status}"