Stop,Start,Kill

Now you can Stop, Start or even Kill the script by simply putting a file in /tmp
This commit is contained in:
steel99xl 2023-09-24 17:22:54 -04:00 committed by GitHub
parent 56d82d35d2
commit bdd782d69d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,22 @@ MinimumBrightness=001
SensorToDisplayScale=24
while true; do
touch '/tmp/AB.running'
until [ -f /tmp/AB.kill ]
do
if [[ -f /tmp/AB.stop ]]
then
rm '/tmp/AB.stop'
rm '/tmp/AB.running'
until [[ -f /tmp/AB.start ]]
do
sleep 10
done
rm '/tmp/AB.start'
touch '/tmp/AB.running'
else
Light=$(cat /sys/bus/iio/devices/iio\:device0/in_illuminance_raw)
CurrentBrightness=$(cat /sys/class/backlight/intel_backlight/brightness)
@ -48,5 +63,7 @@ do
done
sleep $SensorDelay
fi
done
rm '/tmp/AutoBright.kill'