mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
27 lines
943 B
Bash
Executable file
27 lines
943 B
Bash
Executable file
#!/bin/sh
|
|
|
|
basemac="$(db -q get hw.board.basemac | tr -d ':')"
|
|
|
|
if [ -s "/etc/config/pon" ]; then
|
|
if uci -q get pon.globals >/dev/null; then
|
|
# return if there is any valid content
|
|
exit
|
|
else
|
|
rm -f /etc/config/pon
|
|
fi
|
|
fi
|
|
touch /etc/config/pon
|
|
|
|
mac=''
|
|
if [ -z "$basemac" ]; then
|
|
mac="12345678"
|
|
else
|
|
# read last 8 characters of basemac without :
|
|
mac=${basemac: -8}
|
|
fi
|
|
|
|
uci set pon.globals=globals
|
|
uci set pon.globals.enabled="1"
|
|
uci set pon.globals.serial_number="BRCM$mac"
|
|
|
|
uci commit pon
|