get_config_cid_ifaces() {
local _ifaces
- config_get _ifaces 'config' 'cid_interface'
+ config_get _ifaces 'config' "$2"
local _iface _ifnames=""
for _iface in $_ifaces; do
local lldp_hostname
config_get lldp_hostname 'config' 'lldp_hostname' "$(cat /proc/sys/kernel/hostname)"
- local ifaces
- config_get ifaces 'config' 'interface'
-
- local iface ifnames=""
- for iface in $ifaces; do
- local ifname=""
- if network_get_device ifname "$iface" || [ -e "/sys/class/net/$iface" ]; then
- append ifnames "${ifname:-$iface}" ","
- fi
- done
+ local ifnames
+ get_config_cid_ifaces ifnames "interface"
local lldp_mgmt_ip
config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip'
# Clear out the config file first
echo -n > "$LLDPD_CONF"
- [ -n "$ifnames" ] && echo "configure system interface pattern" "$ifnames" >> "$LLDPD_CONF"
+ [ -n "$ifnames" ] && echo "configure system interface pattern $ifnames" >> "$LLDPD_CONF"
[ -n "$lldp_description" ] && echo "configure system description" "\"$lldp_description\"" >> "$LLDPD_CONF"
[ -n "$lldp_hostname" ] && echo "configure system hostname" "\"$lldp_hostname\"" >> "$LLDPD_CONF"
[ -n "$lldp_mgmt_ip" ] && echo "configure system ip management pattern" "\"$lldp_mgmt_ip\"" >> "$LLDPD_CONF"
# ChassisID interfaces
local ifnames
- get_config_cid_ifaces ifnames
+ get_config_cid_ifaces ifnames "cid_interface"
+
[ -n "$ifnames" ] && procd_append_param command -C "$ifnames"
# Overwrite default configuration locations processed by lldpcli at start