mirror of https://github.com/hak5/openwrt.git
Revert "base-files: rename hostname with EUI of mac address"
This reverts commit 6170c46b47
.
There has been demand for further evaluation of the impact of a
changed hostname, so this is reverted for now. The default hostname
will be "OpenWrt" again after this commit.
The macaddr_geteui() function is not removed by this revert.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
master
parent
6170c46b47
commit
22b8a6263d
|
@ -3,7 +3,6 @@
|
||||||
CFG=/etc/board.json
|
CFG=/etc/board.json
|
||||||
|
|
||||||
. /usr/share/libubox/jshn.sh
|
. /usr/share/libubox/jshn.sh
|
||||||
. /lib/functions/system.sh
|
|
||||||
|
|
||||||
[ -s $CFG ] || /bin/board_detect || exit 1
|
[ -s $CFG ] || /bin/board_detect || exit 1
|
||||||
[ -s /etc/config/network -a -s /etc/config/system ] && exit 0
|
[ -s /etc/config/network -a -s /etc/config/system ] && exit 0
|
||||||
|
@ -254,22 +253,9 @@ generate_static_system() {
|
||||||
add_list system.ntp.server='3.openwrt.pool.ntp.org'
|
add_list system.ntp.server='3.openwrt.pool.ntp.org'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
local label_macaddr=$(get_mac_label_dt)
|
if json_is_a system object; then
|
||||||
|
json_select system
|
||||||
local hostname
|
local hostname
|
||||||
|
|
||||||
if json_is_a system object; then
|
|
||||||
json_select system
|
|
||||||
[ -n "$label_macaddr" ] || json_get_var label_macaddr label_macaddr
|
|
||||||
json_select ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$label_macaddr" ]; then
|
|
||||||
hostname="OpenWrt-$(macaddr_geteui $label_macaddr)"
|
|
||||||
uci -q set "system.@system[-1].hostname=$hostname"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if json_is_a system object; then
|
|
||||||
json_select system
|
|
||||||
if json_get_var hostname hostname; then
|
if json_get_var hostname hostname; then
|
||||||
uci -q set "system.@system[-1].hostname=$hostname"
|
uci -q set "system.@system[-1].hostname=$hostname"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue