diff --git a/openwrt/files/etc/udhcpc.user b/openwrt/files/etc/udhcpc.user index ce3b7424..153da1c0 100644 --- a/openwrt/files/etc/udhcpc.user +++ b/openwrt/files/etc/udhcpc.user @@ -22,9 +22,11 @@ case "$1" in fi if [ ! -z "$hostname" ]; then - uci set 'system.@system[0].hostname'="$hostname" - uci commit if [ `echo "$HOSTNAME" | tr '[A-Z]' '[a-z]'` != `echo "$hostname" | tr '[A-Z]' '[a-z]'` ]; then + # set new hostname + uci set 'system.@system[0].hostname'="$hostname" + uci commit + # reload/restart whatever needs the hostname updated /etc/init.d/system reload service zabbix_agentd restart