mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
64 lines
1.2 KiB
Bash
64 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
|
|
set_serial_number() {
|
|
vendor_id=$1
|
|
vssn=$2
|
|
|
|
# Vendor id is not taken from serial automatically, propagate it as well
|
|
/userfs/bin/omcicfgCmd set vendorId ${vendor_id}
|
|
/userfs/bin/omcicfgCmd set sn ${vendor_id}${vssn}
|
|
}
|
|
|
|
set_equipment_id() {
|
|
local eqid=$1
|
|
local eq_id_default="KE2.119.241R2B"
|
|
|
|
if [ -z "$eqid" ]; then
|
|
return
|
|
fi
|
|
|
|
if [ "$eqid" = "$eq_id_default" ]; then
|
|
return
|
|
fi
|
|
|
|
/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 loidPasswd ${loid_pwd}
|
|
fi
|
|
}
|
|
|
|
apply_xpon_uci_config() {
|
|
configure_loid_authentication
|
|
configure_equipment_id
|
|
}
|
|
|
|
init_xpon() {
|
|
# don't start pon daemons if xpon module is not loaded
|
|
[ -d /sys/module/xpon -o -d /sys/module/xpon_10g ] || return
|
|
|
|
procd_open_instance ponmgr_cfg
|
|
procd_set_param command /userfs/bin/ponmgr_cfg
|
|
procd_set_param respawn
|
|
procd_close_instance
|
|
procd_open_instance omci
|
|
procd_set_param command /userfs/bin/omci
|
|
procd_set_param respawn
|
|
procd_close_instance
|
|
}
|
|
|
|
deinit_xpon() {
|
|
return
|
|
}
|
|
|