summaryrefslogtreecommitdiff
path: root/network/lldpd/rc.lldpd
diff options
context:
space:
mode:
authorThibaut Notteboom <thibaut.notteboom@gmail.com>2017-03-12 00:18:06 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-03-18 06:58:13 +0700
commit287346028fe6fff374c4be88e1156ea0e079e7fe (patch)
tree9858c83480ca2e6accbcc006210751671e799dba /network/lldpd/rc.lldpd
parentfe183a3c4da659e7b148b737d17d1f00d16faadd (diff)
downloadslackbuilds-287346028fe6fff374c4be88e1156ea0e079e7fe.tar.gz
network/lldpd: Added (an implementation of IEEE 802.1ab (LLDP)).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
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
+