lldpd: add lldp_syscapabilities config option
authorSebastian Pflieger <sebastian@pflieger.email>
Wed, 20 Sep 2023 18:13:14 +0000 (20:13 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Sep 2023 15:07:28 +0000 (17:07 +0200)
allow to overwrite the detected system capabilities e.g. if devices
does not operate as bridge.

Signed-off-by: Sebastian Pflieger <sebastian@pflieger.email>
package/network/services/lldpd/files/lldpd.init

index 5b39144921f10afa3e232e67c8b53d5416f8ac2b..e1e8ac9fd4a5f7b068b7c119bc4e7e60a72f975b 100644 (file)
@@ -45,12 +45,16 @@ write_lldpd_conf()
        local lldp_mgmt_ip
        config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip'
 
+       local lldp_syscapabilities
+       config_get lldp_syscapabilities 'config' 'lldp_syscapabilities'
+
        # Clear out the config file first
        echo -n > "$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"
+       [ -n "$lldp_syscapabilities" ] && echo "configure system capabilities enabled" "\"$lldp_syscapabilities\"" >> "$LLDPD_CONF"
 
        # Since lldpd's sysconfdir is /tmp, we'll symlink /etc/lldpd.d to /tmp/$LLDPD_CONFS_DIR
        [ -e $LLDPD_CONFS_DIR ] || ln -s /etc/lldpd.d $LLDPD_CONFS_DIR