2008-12-30 07:38:11 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2011-11-16 09:44:06 +00:00
|
|
|
# Copyright (C) 2008-2011 OpenWrt.org
|
2008-12-30 07:38:11 +00:00
|
|
|
|
|
|
|
START=90
|
|
|
|
|
2011-11-16 09:44:06 +00:00
|
|
|
SERVICE_USE_PID=1
|
|
|
|
|
2008-12-30 07:38:11 +00:00
|
|
|
start() {
|
|
|
|
local enable_cdp
|
|
|
|
local enable_fdp
|
|
|
|
local enable_sonmp
|
|
|
|
local enable_edp
|
|
|
|
local lldp_class
|
|
|
|
local lldp_location
|
2011-11-16 09:44:06 +00:00
|
|
|
|
|
|
|
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_location:+ -L "$lldp_location"} \
|
|
|
|
${lldp_class:+ -M $lldp_class}
|
2008-12-30 07:38:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2011-11-16 09:44:06 +00:00
|
|
|
service_stop /usr/sbin/lldpd
|
2008-12-30 07:38:11 +00:00
|
|
|
}
|