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:
@@ -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
|
||||
}
|
||||
|
5
firmware_mod/scripts/nightmode.sh
Normal file
5
firmware_mod/scripts/nightmode.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /system/sdcard/scripts/common_functions.sh
|
||||
|
||||
night_mode $1
|
Reference in New Issue
Block a user