From 39e175b01051507027528eafd7e18e7e30ae5ffc Mon Sep 17 00:00:00 2001 From: jmtatsch Date: Thu, 20 Feb 2020 14:49:39 +0100 Subject: [PATCH] Fix new parameters not applied properly to autonight executable. Fixes #1145 --- .../controlscripts/auto-night-detection | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/firmware_mod/controlscripts/auto-night-detection b/firmware_mod/controlscripts/auto-night-detection index ba0a234..75d70f1 100644 --- a/firmware_mod/controlscripts/auto-night-detection +++ b/firmware_mod/controlscripts/auto-night-detection @@ -12,16 +12,17 @@ status() start() { - AUTONIGHT_OPTS= - if [ -f $CONF_FILE ] - then - AUTONIGHT_OPTS=$(cat $CONF_FILE) - fi + . $CONF_FILE if [ -f /run/auto-night-detection.pid ]; then - echo "Auto Night Detection already running"; + echo "Auto night detection already running"; else - echo "Starting Auto Night Detection" - /system/sdcard/bin/busybox nohup /system/sdcard/bin/autonight $AUTONIGHT_OPTS &>/dev/null & + if [ "$autonight_mode" == "sw" ]; then + echo "Starting software auto night detection" + /system/sdcard/bin/busybox nohup /system/sdcard/bin/autonight $sw_parameters &>/dev/null & + else + echo "Starting hardware auto night detection" + /system/sdcard/bin/busybox nohup /system/sdcard/bin/autonight $hw_parameters &>/dev/null & + fi echo "$!" > "$PIDFILE" fi }