Skip to content
Snippets Groups Projects
Commit 885e8334 authored by minute's avatar minute
Browse files

Merge branch 'reform-standby' into 'main'

sbin/reform-standby: guard against script being called manually

See merge request reform/reform-tools!22
parents ad2062d8 d2013e51
No related branches found
No related tags found
No related merge requests found
......@@ -39,13 +39,13 @@ hantro_on() {
kbd_backlight_off() {
for d in /dev/hidraw*
do echo -en "xLITE0" > $d
do echo -en "xLITE0" > "$d"
done
}
kbd_backlight_on() {
for d in /dev/hidraw*
do echo -en "xLITE6" > $d
do echo -en "xLITE6" > "$d"
done
}
......@@ -59,17 +59,28 @@ hid_unbind() {
echo 0003:03EB:2042.0001 > /sys/bus/hid/drivers/hid-generic/unbind
}
if [[ $1 = "suspend" ]]; then
case $1 in
suspend)
setup_wake
wifi_off
hantro_off
kbd_backlight_off
hid_unbind
fi
if [[ $1 = "resume" ]]; then
;;
resume)
kbd_backlight_on
wifi_on
hantro_on
hid_bind
fi
;;
*)
echo "i.MX8MQ specific setup before suspend and after wakeup" >&2
echo "" >&2
echo "usage:" >&2
echo " $0 [suspend|resume]" >&2
echo "" >&2
echo "This script is called by the reform-sleep.service systemd service." >&2
echo "Do not call this script manually from the terminal but use" >&2
echo "systemctl suspend instead." >&2
exit 1
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment