diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-10 13:17:14 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-10 13:17:14 +0000 |
commit | 2698a0226e302e2e3162753fcd776316f546df2a (patch) | |
tree | 7d320422192981acd2453afcff8a0e144a93a38c /package/network/services/lldpd/files | |
parent | 62b7377df912e7ab298d5ca434266e1ca7a5fd8e (diff) |
lldpd: move to trunk and add myself as maintainer
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33700 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services/lldpd/files')
-rw-r--r-- | package/network/services/lldpd/files/lldpd.config | 8 | ||||
-rw-r--r-- | package/network/services/lldpd/files/lldpd.init | 40 |
2 files changed, 48 insertions, 0 deletions
diff --git a/package/network/services/lldpd/files/lldpd.config b/package/network/services/lldpd/files/lldpd.config new file mode 100644 index 000000000..14ba02fcc --- /dev/null +++ b/package/network/services/lldpd/files/lldpd.config @@ -0,0 +1,8 @@ +config lldpd config + option enable_cdp 1 + option enable_fdp 1 + option enable_sonmp 1 + option enable_edp 1 + + option lldp_class 4 + option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4" diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init new file mode 100644 index 000000000..5d3428388 --- /dev/null +++ b/package/network/services/lldpd/files/lldpd.init @@ -0,0 +1,40 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2012 OpenWrt.org + +START=90 + +SERVICE_USE_PID=1 + +start() { + local enable_cdp + local enable_fdp + local enable_sonmp + local enable_edp + local lldp_class + local lldp_location + + config_load 'lldpd' + config_get_bool enable_cdp 'config' 'enable_cdp' 0 + config_get_bool enable_fdp 'config' 'enable_fdp' 0 + config_get_bool enable_sonmp 'config' 'enable_sonmp' 0 + config_get_bool enable_edp 'config' 'enable_edp' 0 + config_get lldp_class 'config' 'lldp_class' + config_get lldp_location 'config' 'lldp_location' + + [ $enable_cdp -gt 0 ] && append args '-c' + [ $enable_fdp -gt 0 ] && append args '-f' + [ $enable_sonmp -gt 0 ] && append args '-s' + [ $enable_edp -gt 0 ] && append args '-e' + + service_start /usr/sbin/lldpd $args \ + ${lldp_class:+ -M $lldp_class} + + [ -n "$lldp_location" ] && { + sleep 1 + /usr/sbin/lldpctl -L "$lldp_location" > /dev/null 2>&1 + } +} + +stop() { + service_stop /usr/sbin/lldpd +} |