Commit 9faa95e1 authored by Ronny Nilsson's avatar Ronny Nilsson
Browse files

In Iopsys 5 each subsystem has to take care of its own data.

OUI in UCI is not created automatically for CWMP (or any
other package). Anyone who needs it has to fix it them self.
parent a3d50dc6
Pipeline #385 failed with stage
in 52 seconds
# Copy defaults by the factory to the UCI user
# section, where the user can modify it.
[ -s "/etc/device_info" ] || exit 0
source "/etc/device_info"
# Get factory base MAC.
baseMac=$(db -q get hw.board.BaseMacAddr)
# Erase colon and space characters.
baseMac=${baseMac//:/}
baseMac=${baseMac// /}
# Get factory serial number.
serial=$(db get hw.board.serialNumber)
# Create user IDs in OUI-SERIAL format.
for section in acs cpe; do
if uci -q get cwmp.${section} >/dev/null; then
userid=$(uci -q get cwmp.${section}.userid)
# We are compatible with both Iopsys 4 and 5 here, which
# enforce extra sanity checks before writing to UCI. Is
# the variable missing or containing '$'?
if echo "$userid" | grep -qE "^$|\\$"; then
doSet="$doSet"$'\n'"set cwmp.${section}.userid=${baseMac:0:6}-${serial}"
fi
fi
done
# Commit the above.
if [ -n "${doSet}" ]; then
echo -e "${doSet}\ncommit cwmp" | uci -q batch
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment