From c0542b61da35b687cbbfacbf021db4018df2aae8 Mon Sep 17 00:00:00 2001 From: Jason Howard Date: Fri, 27 Apr 2018 21:27:59 -0700 Subject: [PATCH] Added nightmode.sh script (to be called by the new autonight binary) and changes to auto-night-detection control script to start and stop new autonight binary. (#305) --- firmware_mod/controlscripts/auto-night-detection | 8 +++++++- firmware_mod/scripts/nightmode.sh | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 firmware_mod/scripts/nightmode.sh diff --git a/firmware_mod/controlscripts/auto-night-detection b/firmware_mod/controlscripts/auto-night-detection index 2414489..ba0a234 100644 --- a/firmware_mod/controlscripts/auto-night-detection +++ b/firmware_mod/controlscripts/auto-night-detection @@ -1,5 +1,6 @@ #!/bin/sh PIDFILE="/run/auto-night-detection.pid" +CONF_FILE="/system/sdcard/config/autonight.conf" status() { @@ -11,11 +12,16 @@ status() start() { + AUTONIGHT_OPTS= + if [ -f $CONF_FILE ] + then + AUTONIGHT_OPTS=$(cat $CONF_FILE) + fi if [ -f /run/auto-night-detection.pid ]; then echo "Auto Night Detection already running"; else echo "Starting Auto Night Detection" - /system/sdcard/bin/busybox nohup /system/sdcard/scripts/ldr.sh &>/dev/null & + /system/sdcard/bin/busybox nohup /system/sdcard/bin/autonight $AUTONIGHT_OPTS &>/dev/null & echo "$!" > "$PIDFILE" fi } diff --git a/firmware_mod/scripts/nightmode.sh b/firmware_mod/scripts/nightmode.sh new file mode 100644 index 0000000..a1fc147 --- /dev/null +++ b/firmware_mod/scripts/nightmode.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +. /system/sdcard/scripts/common_functions.sh + +night_mode $1