1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-03 13:12:44 +02:00

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)

This commit is contained in:
Jason Howard
2018-04-27 21:27:59 -07:00
committed by jmtatsch
parent 7f11058140
commit c0542b61da
2 changed files with 12 additions and 1 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,5 @@
#!/bin/sh
. /system/sdcard/scripts/common_functions.sh
night_mode $1