summaryrefslogtreecommitdiff
path: root/network/lldpd/rc.lldpd
diff options
context:
space:
mode:
Diffstat (limited to 'network/lldpd/rc.lldpd')
-rw-r--r--network/lldpd/rc.lldpd33
1 files changed, 33 insertions, 0 deletions
diff --git a/network/lldpd/rc.lldpd b/network/lldpd/rc.lldpd
new file mode 100644
index 0000000000..023173b6c1
--- /dev/null
+++ b/network/lldpd/rc.lldpd
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+mkdir -p /run/lldpd
+
+lldpd_start() {
+ /usr/sbin/lldpd >/dev/null 2>&1
+}
+
+lldpd_stop() {
+ killall lldpd
+}
+
+restart() {
+ lldpd_stop
+ sleep 1
+ lldpd_start
+}
+
+case "$1" in
+ 'start')
+ lldpd_start
+ ;;
+ 'stop')
+ lldpd_stop
+ ;;
+ 'restart')
+ lldpd_restart
+ ;;
+ *)
+ echo "Usage: $0 start|stop|restart"
+ ;;
+esac
+