Files
builder/devices/hi3518ev300_lite_xiaomi-mjsxj02hl/general/overlay/etc/init.d/S96autonight
2023-12-10 01:08:49 +03:00

42 lines
663 B
Bash
Executable File

#!/bin/sh
AUTONIGHT_ARGS=""
AUTONIGHT_PID_FILE=/var/run/autonight.pid
start() {
printf "Starting automatic night mode changer: "
umask 077
start-stop-daemon -b -m -S -q -p $AUTONIGHT_PID_FILE \
--exec /usr/sbin/autonight.sh -- $AUTONIGHT_ARGS
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
printf "Stopping automatic night mode changer: "
start-stop-daemon -K -q -p $AUTONIGHT_PID_FILE
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart | reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit $?