mirror of
https://github.com/femtofox/femtofox.git
synced 2026-11-19 14:36:40 -05:00
11 lines
265 B
Bash
11 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
|