Files
wlan-ap/feeds/ucentral/ucentral-schema/files/etc/uci-defaults/99-ucentral-hostname
2025-04-10 08:30:15 +02:00

9 lines
320 B
Plaintext
Executable File

#!/bin.sh
hname=$(cat /etc/board.json | jsonfilter -e '@.system.label_macaddr')
[ -z "$hname" ] && hname=$(cat /sys/class/net/eth0/address)
uci set system.@system[-1].mac=$hname
hname=$(echo $hname | tr -d : | awk '{print tolower($0)}')
uci set system.@system[-1].hostname=$hname
uci set ucentral.config.serial=$hname