ponmngr: handling the loid authentication

This commit is contained in:
Amit Kumar 2023-08-04 15:38:44 +05:30 committed by Rahul Thakur
parent dfa0414918
commit d19c85ebde
3 changed files with 24 additions and 0 deletions

View file

@ -26,6 +26,19 @@ set_equipment_id() {
/userfs/bin/omcicfgCmd set equipmentId ${eqid}
}
set_loid_authentication() {
local loid=$1
local loid_pwd=$2
[ -z "$loid" ] && return
/userfs/bin/omcicfgCmd set loid ${loid}
if [ -n "$loid_pwd" ]; then
/userfs/bin/omcicfgCmd set loid_password ${loid_pwd}
fi
}
init_xpon() {
# don't start pon daemons if xpon module is not loaded
[ -d /sys/module/xpon ] || return

View file

@ -16,6 +16,10 @@ set_equipment_id() {
return
}
set_loid_authentication() {
return
}
generate_xpon_json() {
eqid="$(uci -q get xpon.ani.equipment_id)"
sn="$(uci -q get xpon.ani.serial_number)"

View file

@ -29,10 +29,17 @@ configure_equipment_id() {
set_equipment_id $eqid
}
configure_loid_authentication() {
loid="$(uci -q get xpon.ani.loid)"
loid_pwd="$(uci -q get xpon.ani.loid_password)"
set_loid_authentication $loid $loid_pwd
}
start_service() {
if [ "$(uci -q get xpon.ani.enable)" == "1" ]; then
configure_serial_number
configure_equipment_id
configure_loid_authentication
init_xpon
fi
}