diff --git a/ponmngr/files/airoha/lib/xpon/airoha.sh b/ponmngr/files/airoha/lib/xpon/airoha.sh index 4f22682f1..6a975624d 100644 --- a/ponmngr/files/airoha/lib/xpon/airoha.sh +++ b/ponmngr/files/airoha/lib/xpon/airoha.sh @@ -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 diff --git a/ponmngr/files/broadcom/lib/xpon/broadcom.sh b/ponmngr/files/broadcom/lib/xpon/broadcom.sh index df757bd2e..c58825f90 100644 --- a/ponmngr/files/broadcom/lib/xpon/broadcom.sh +++ b/ponmngr/files/broadcom/lib/xpon/broadcom.sh @@ -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)" diff --git a/ponmngr/files/common/etc/init.d/xpon b/ponmngr/files/common/etc/init.d/xpon index 2fd531a01..b8cf63cdb 100755 --- a/ponmngr/files/common/etc/init.d/xpon +++ b/ponmngr/files/common/etc/init.d/xpon @@ -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 }