mirror of
https://github.com/femtofox/femtofox.git
synced 2026-10-26 19:02:00 -04:00
10 lines
265 B
Bash
10 lines
265 B
Bash
#!/bin/bash
|
|
|
|
logger "$(date): Listening for button press on $DEVICE..."
|
|
|
|
evtest --grab /dev/input/event0 | while read line; do
|
|
if echo $line | grep -q "EV_KEY.*value 1"; then
|
|
logger "Button pressed, triggering reboot..."
|
|
sudo reboot
|
|
fi
|
|
done
|