From f9a4bfa6d629fb796fd4eff83eac165b260cd4ee Mon Sep 17 00:00:00 2001 From: Amit KUmar Date: Tue, 28 Dec 2021 15:18:38 +0530 Subject: [PATCH] ponmngr: added omcid start --- ponmngr/files/etc/init.d/pon | 10 ++++++++-- ponmngr/files/lib/pon/broadcom.sh | 10 +++++----- ponmngr/files/usr/libexec/rpcd/pon | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ponmngr/files/etc/init.d/pon b/ponmngr/files/etc/init.d/pon index c7551f5e2..8dd62fcc8 100755 --- a/ponmngr/files/etc/init.d/pon +++ b/ponmngr/files/etc/init.d/pon @@ -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() { diff --git a/ponmngr/files/lib/pon/broadcom.sh b/ponmngr/files/lib/pon/broadcom.sh index 45e561732..8e0208385 100755 --- a/ponmngr/files/lib/pon/broadcom.sh +++ b/ponmngr/files/lib/pon/broadcom.sh @@ -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;}')" diff --git a/ponmngr/files/usr/libexec/rpcd/pon b/ponmngr/files/usr/libexec/rpcd/pon index 3b740b99d..8aa83dd36 100755 --- a/ponmngr/files/usr/libexec/rpcd/pon +++ b/ponmngr/files/usr/libexec/rpcd/pon @@ -11,7 +11,7 @@ case "$1" in call) case "$2" in status) - get_pon_status + get_gpon_status ;; esac ;;