mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-28 01:47:19 +01:00
ponmngr: added omcid start
This commit is contained in:
parent
e4365786b9
commit
f9a4bfa6d6
3 changed files with 14 additions and 8 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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;}')"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ case "$1" in
|
|||
call)
|
||||
case "$2" in
|
||||
status)
|
||||
get_pon_status
|
||||
get_gpon_status
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue