mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
ucentral-schema: derive hostname from label-mac if present
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#!/bin.sh
|
||||
|
||||
hname=$(cat /sys/class/net/eth0/address | tr -d : | awk '{print tolower($0)}')
|
||||
hname=$(cat /etc/board.json | jsonfilter -e '@.system.label_macaddr')
|
||||
[ -z "$hname" ] && hname=$(cat /sys/class/net/eth0/address)
|
||||
hname=$(echo $hname | tr -d : | awk '{print tolower($0)}')
|
||||
uci set system.@system[-1].hostname=$hname
|
||||
uci set ucentral.config.serial=$hname
|
||||
|
||||
Reference in New Issue
Block a user