diff options
author | Daniel A. Maierhofer <git@damadmai.at> | 2020-02-26 21:44:45 +0100 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2020-05-08 05:54:39 +0300 |
commit | 128250e8fc615aebe05642f023375dd7902808e1 (patch) | |
tree | f17d0b6e7a4ec6c6bd2f01b291edf674aaa506d6 /package/network/services/lldpd/files/lldpd.init | |
parent | 73fa1aba94f5cf566007ac18cee3ef08b3ae64bc (diff) | |
download | upstream-128250e8fc615aebe05642f023375dd7902808e1.tar.gz upstream-128250e8fc615aebe05642f023375dd7902808e1.tar.bz2 upstream-128250e8fc615aebe05642f023375dd7902808e1.zip |
lldpd: add management IP setting
add option to set management IP pattern
also add missing 'unconfigure system hostname'
for example pattern '!192.168.1.1' makes it possible that
WAN IP is selected instead of LAN IP
Signed-off-by: Daniel A. Maierhofer <git@damadmai.at>
[grammar and spelling fixes in commit message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Diffstat (limited to 'package/network/services/lldpd/files/lldpd.init')
-rw-r--r-- | package/network/services/lldpd/files/lldpd.init | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 9fb3a82559..7a5b25e016 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -42,11 +42,15 @@ write_lldpd_conf() fi done + 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 "$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" # 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 @@ -103,6 +107,8 @@ reload_service() { unconfigure lldp custom-tlv unconfigure system interface pattern unconfigure system description + unconfigure system hostname + unconfigure system ip management pattern EOF # Rewrite lldpd.conf # If something changed it should be included by the lldpcli call |