ponmngr: added omcid start

This commit is contained in:
Amit KUmar 2021-12-28 15:18:38 +05:30
parent e4365786b9
commit f9a4bfa6d6
3 changed files with 14 additions and 8 deletions

View file

@ -5,13 +5,18 @@ STOP=10
USE_PROCD=1
NAME=ponmngr
PROG="/usr/sbin/omcid start"
include /lib/pon
start_service() {
if [ -f "/etc/config/pon" ]; then
start_pon
procd_open_instance $NAME
procd_set_param command ${PROG}
procd_set_param respawn
procd_close_instance
start_gpon
fi
}
@ -20,7 +25,8 @@ boot() {
}
stop_service() {
stop_pon
service_stop ${PROG}
stop_gpon
}
reload_service() {

View file

@ -24,7 +24,7 @@ configure_snpwd() {
fi
}
configure_pon() {
configure_gpon() {
local enabled serial_no password
config_load pon
config_get enabled globals "enabled"
@ -39,20 +39,20 @@ configure_pon() {
configure_snpwd $serial_no $password
}
start_pon() {
start_gpon() {
if [ -n "$(which gponctl)" ]; then
configure_pon
configure_gpon
gponctl start
fi
}
stop_pon() {
stop_gpon() {
if [ -n "$(which gponctl)" ]; then
gponctl stop
fi
}
get_pon_status() {
get_gpon_status() {
json_init
status="$(gponctl getstate)"
admin_status="$(echo $status | head -n1 | awk '{print $8;}')"

View file

@ -11,7 +11,7 @@ case "$1" in
call)
case "$2" in
status)
get_pon_status
get_gpon_status
;;
esac
;;