add Xiaomi MJSXJ02HL

This commit is contained in:
cronyx
2023-12-10 01:08:49 +03:00
parent d79140919f
commit 90a410ad48
13 changed files with 639 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
#!/bin/sh
AUTOLED_ARGS=""
AUTOLED_PID_FILE=/var/run/autoled.pid
start() {
printf "Starting automatic LED control: "
umask 077
start-stop-daemon -b -m -S -q -p $AUTOLED_PID_FILE \
--exec /usr/sbin/autoled.sh -- $AUTOLED_ARGS
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
printf "Stopping automatic LED control: "
start-stop-daemon -K -q -p $AUTOLED_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 $?

View File

@@ -0,0 +1,28 @@
#!/bin/sh
case "$1" in
start | restart | reload)
if [ ! -d /sys/class/gpio/gpio0/ ]; then
echo 0 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio0/direction
fi
printf "Checking the reset button: "
if [ $(cat /sys/class/gpio/gpio0/value) -eq 0 ]; then
echo "PRESSED"
# Wipe overlay partition and reboot
echo "Let's start wipe overlay partition (/dev/mtd4)"
/usr/sbin/sysupgrade -n -z
else
echo "NOT PRESSED"
fi
exit $?
;;
stop)
exit 0
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac

View File

@@ -0,0 +1,41 @@
#!/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 $?