3 # openl2tpd Start/Stop the OpenL2TP protocol daemon.
5 # chkconfig: 2345 57 76
6 # description: OpenL2TP is a complete implementation of RFC2661 - Layer Two Tunneling
7 # Protocol Version 2, able to operate as both a server and a client. It
8 # can be used to implement L2TP VPNs. As a server, it can handle
9 # hundreds of tunnels and sessions.
10 # processname: openl2tpd
11 # config: /etc/sysconfig/openl2tpd
12 # pidfile: /var/run/openl2tpd.pid
14 # Source function library.
15 . /etc/init.d/functions
18 OPENL2TPD_CONFIG_FILE=""
20 [ -f /etc/sysconfig/openl2tpd ] && . /etc/sysconfig/openl2tpd
23 # Check if the service is already running?
24 if [ -f /var/lock/subsys/openl2tpd ]; then
25 msg_already_running "openl2tpd"
29 msg_starting "openl2tpd"
30 emit starting JOB=openl2tpd
32 modprobe -s pppol2tp || modprobe -s l2tp_ppp
34 if [ $RETVAL -eq 0 ]; then
35 daemon openl2tpd $OPENL2TPDARGS
38 if [ $RETVAL -eq 0 ]; then
39 touch /var/lock/subsys/openl2tpd
40 emit started JOB=openl2tpd
41 if [ -n "$OPENL2TPD_CONFIG_FILE" -a -f "$OPENL2TPD_CONFIG_FILE" ]; then
43 show "Restoring saved openl2tpd configuration..." ; busy
44 /usr/bin/l2tpconfig config restore file="$OPENL2TPD_CONFIG_FILE"
46 if [ $RETVAL -eq 0 ] ; then
56 if [ ! -f /var/lock/subsys/openl2tpd ]; then
57 msg_not_running "openl2tpd"
60 msg_stopping "openl2tpd"
62 emit --no-wait stopped JOB=openl2tpd
63 rm -f /var/run/openl2tpd.pid /var/lock/subsys/openl2tpd >/dev/null 2>&1
68 if [ ! -f /var/lock/subsys/openl2tpd ]; then
69 msg_not_running "openl2tpd"
84 if [ ! -f /var/lock/subsys/openl2tpd ]; then
85 msg_not_running "openl2tpd"
90 if [ -n "$OPENL2TPD_CONFIG_FILE" -a -f "$OPENL2TPD_CONFIG_FILE" ]; then
91 msg_reloading "openl2tpd"
92 /usr/bin/l2tpconfig config restore file="$OPENL2TPD_CONFIG_FILE"
94 if [ $RETVAL -eq 0 ] ; then
106 # See how we were called.
126 l2tpconfig system show status
132 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"