mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
ponmngr: Add support for PLOAM password.
This commit is contained in:
parent
2a2650b43e
commit
363c2ff155
4 changed files with 49 additions and 0 deletions
|
|
@ -53,6 +53,17 @@ set_serial_number() {
|
|||
/userfs/bin/omcicfgCmd set sn "${vendor_id}${vssn}"
|
||||
}
|
||||
|
||||
set_ploam_password() {
|
||||
local passwd="$1"
|
||||
local hex="$2"
|
||||
|
||||
if [ -z "$hex" -o "$hex" = "0" ]; then
|
||||
/userfs/bin/omcicfgCmd set passwdAscii "${passwd}"
|
||||
else
|
||||
/userfs/bin/omcicfgCmd set passwdHex "${passwd}"
|
||||
fi
|
||||
}
|
||||
|
||||
set_equipment_id() {
|
||||
local eqid="$1"
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,17 @@ set_serial_number() {
|
|||
bs /b/c gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vssn}
|
||||
}
|
||||
|
||||
set_ploam_password() {
|
||||
local passwd="$1"
|
||||
local hex="$2"
|
||||
|
||||
if [ -z "$hex" -o "$hex" = "0" ]; then
|
||||
passwd="$(echo -n "${passwd}" | hexdump -e '"%02X"' -v)"
|
||||
fi
|
||||
|
||||
bs /b/c gpon password=${passwd}
|
||||
}
|
||||
|
||||
set_equipment_id() {
|
||||
local equipment_id="$1"
|
||||
[ -z "$equipment_id" ] && return
|
||||
|
|
|
|||
|
|
@ -24,9 +24,21 @@ configure_serial_number() {
|
|||
set_serial_number "${vendor_id}" "${vssn}"
|
||||
}
|
||||
|
||||
configure_ploam_password() {
|
||||
local passwd="$(uci -q get xpon.ani.ploam_password)"
|
||||
local hex="$(uci -q get xpon.ani.ploam_hexadecimalpassword)"
|
||||
|
||||
if [ -z "${passwd}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
set_ploam_password "${passwd}" "${hex}"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ "$(uci -q get xpon.ani.enable)" = "1" ]; then
|
||||
configure_serial_number
|
||||
configure_ploam_password
|
||||
apply_xpon_uci_config
|
||||
init_xpon
|
||||
else
|
||||
|
|
|
|||
|
|
@ -15,6 +15,19 @@ configure_serial_number() {
|
|||
fi
|
||||
}
|
||||
|
||||
configure_ploam_password() {
|
||||
# check if PLOAM password is present in the production data
|
||||
local passwd="$(uci -q get xpon.ani.ploam_password)"
|
||||
|
||||
if [ -z "${passwd}" ]; then
|
||||
local production_passwd="$(fw_printenv -n gponpswd)"
|
||||
if [ -n ${#production_passwd} ]; then
|
||||
uci set xpon.ani.ploam_password="${production_passwd}"
|
||||
uci set xpon.ani.ploam_hexadecimalpassword=0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_loid_authentication() {
|
||||
local production_loid
|
||||
local production_loidpwd
|
||||
|
|
@ -45,6 +58,7 @@ if [ -s "/etc/config/xpon" ]; then
|
|||
if [ ${#SERIAL_NUMBER} -ne 12 ]; then
|
||||
configure_serial_number
|
||||
fi
|
||||
configure_ploam_password
|
||||
configure_loid_authentication
|
||||
exit
|
||||
else
|
||||
|
|
@ -56,5 +70,6 @@ touch /etc/config/xpon
|
|||
uci set xpon.ani=ani
|
||||
uci set xpon.ani.enable="1"
|
||||
configure_serial_number
|
||||
configure_ploam_password
|
||||
configure_loid_authentication
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue