dectmngr: cosmetic changes in init script

This commit is contained in:
Andreas Gnau 2023-03-21 09:21:13 +00:00 committed by Yalu Zhang
parent 964cff4e75
commit 9a3777dde9

View file

@ -19,7 +19,7 @@ stop_and_wait_dectmngr() {
pidof $NAME && sleep 2 # wait for the process to stop gracefully
while pidof $NAME; do
killall -q -9 $NAME
killall -q -9 $NAME
sleep 1
done
}
@ -51,18 +51,22 @@ start_service() {
config_get log_dect_cmbs global log_dect_cmbs syslog
procd_open_instance
if [ "$log_dect_cmbs" = "none" ]; then
case "$log_dect_cmbs" in
none)
echo "Starting dectmngr with cmbs logging disabled"
procd_set_param command $PROG -comname ttyH0 $opt_ext
rm -f $LOG_PATH/*
elif [ "$log_dect_cmbs" = "file" ]; then
;;
file)
echo "Starting dectmngr with cmbs logging enabled to file"
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
else
;;
*)
echo "Starting dectmngr with cmbs logging enabled to syslog"
procd_set_param command $PROG -comname ttyH0 -syslog $opt_ext
rm -f $LOG_PATH/*
fi
;;
esac
procd_set_param respawn 6 2 3
procd_set_param term_timeout 20
@ -81,8 +85,7 @@ reload_service() {
ubus call dect reload
}
service_triggers()
{
service_triggers() {
procd_add_config_trigger "config.change" "asterisk" /etc/init.d/dectmngr restart
procd_add_config_trigger "config.change" "dect" /etc/init.d/dectmngr reload
}
@ -97,4 +100,3 @@ boot() {
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
start
}