updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / openl2tp / rc.openl2tpd
blobb2cd59a9c18960ac11bf0ca5b033577568102713
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 SYS_LIBDIR="/usr/lib"
8 PID=`pidof -o %PPID /usr/sbin/openl2tpd`
9 case "$1" in
10 start)
11 stat_busy "Starting OpenL2TP Daemon"
12 [ -z "$PID" ] && /usr/sbin/openl2tpd -p $SYS_LIBDIR/openl2tp/ppp_unix.so
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon openl2tpd
17 stat_done
20 stop)
21 stat_busy "Stopping OpenL2TP Daemon"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon openl2tpd
27 stat_done
30 restart)
31 $0 stop
32 sleep 1
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0