aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorLucian Cristian <lucian.cristian@gmail.com>2019-05-10 00:19:07 +0300
committerChristian Lamparter <chunkeey@gmail.com>2019-05-11 16:37:11 +0200
commit4582fe7c14e68d1351b40f1d1fcfd544a9eee668 (patch)
tree796cd488f7c4b44b2ae1a7379346270199653cea /package
parentcb30971a448f3af06163dfac6003b869e6dd0dfc (diff)
downloadupstream-4582fe7c14e68d1351b40f1d1fcfd544a9eee668.tar.gz
upstream-4582fe7c14e68d1351b40f1d1fcfd544a9eee668.tar.bz2
upstream-4582fe7c14e68d1351b40f1d1fcfd544a9eee668.zip
lldpd: add option to edit hostname
also fixes the annoying repeating syslog lldp[]: unable to get system name Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
Diffstat (limited to 'package')
-rw-r--r--package/network/services/lldpd/files/lldpd.config1
-rw-r--r--package/network/services/lldpd/files/lldpd.init4
2 files changed, 5 insertions, 0 deletions
diff --git a/package/network/services/lldpd/files/lldpd.config b/package/network/services/lldpd/files/lldpd.config
index 36b43c89da..e16643c1f7 100644
--- a/package/network/services/lldpd/files/lldpd.config
+++ b/package/network/services/lldpd/files/lldpd.config
@@ -11,6 +11,7 @@ config lldpd config
# if empty, the distribution description is sent
#option lldp_description "OpenWrt System"
+ #option lldp_hostname "Modified Hostname"
# interfaces to listen on
list interface "loopback"
diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index c3d9ba0506..bc429de484 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -28,6 +28,9 @@ write_lldpd_conf()
config_load 'lldpd'
config_get lldp_description 'config' 'lldp_description' "$(find_release_info)"
+ local lldp_hostname
+ config_get lldp_hostname 'config' 'lldp_hostname' "$(cat /proc/sys/kernel/hostname)"
+
local ifaces
config_get ifaces 'config' 'interface'
@@ -43,6 +46,7 @@ write_lldpd_conf()
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"
# 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