diff --git a/dectmngr/files/etc/init.d/dectmngr b/dectmngr/files/etc/init.d/dectmngr index c91bc33a3..015461f38 100755 --- a/dectmngr/files/etc/init.d/dectmngr +++ b/dectmngr/files/etc/init.d/dectmngr @@ -40,8 +40,18 @@ start_service() { model_id="01.02.03" [ -n "$model_id" -a ${#model_id} -eq 8 ] && opt_ext="$opt_ext -model $model_id" + config_load asterisk + config_get_bool log_dect_cmbs general log_dect_cmbs 0 + procd_open_instance - procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext + if [ $log_dect_cmbs -eq 0 ]; then + echo "Starting dectmngr with cmbs logging disabled" + procd_set_param command $PROG -comname ttyH0 $opt_ext + rm -f $LOG_PATH/* + else + echo "Starting dectmngr with cmbs logging enabled" + procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext + fi procd_set_param respawn 6 2 3 procd_set_param term_timeout 20 procd_set_param triggers asterisk