updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / lldpd / rc.d
blob79e7a578dde7e91b56b17e20980e7261a027c480
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON=lldpd
7 ARGS=
9 [ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
11 PID=$(get_pid $DAEMON)
13 case "$1" in
14 start)
15 stat_busy "Starting $DAEMON"
16 [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
17 if [ $? = 0 ]; then
18 add_daemon $DAEMON
19 stat_done
20 else
21 stat_fail
22 exit 1
25 stop)
26 stat_busy "Stopping $DAEMON"
27 [ -n "$PID" ] && kill $PID &>/dev/null
28 if [ $? = 0 ]; then
29 rm_daemon $DAEMON
30 stat_done
31 else
32 stat_fail
33 exit 1
36 restart)
37 $0 stop
38 sleep 1
39 $0 start
42 echo "usage: $0 {start|stop|restart}"
43 esac