2014-07-05 18:11:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
wait=3
|
|
|
|
|
|
|
|
|
|
|
|
wait_setup_mode() {
|
|
|
|
sleep $wait
|
2022-04-05 21:16:30 +00:00
|
|
|
gluon-enter-setup-mode
|
2014-07-05 18:11:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-09-30 19:38:40 +00:00
|
|
|
if [ "$BUTTON" = wps ] || [ "$BUTTON" = reset ] || [ "$BUTTON" = phone ]; then
|
2014-07-05 18:11:41 +00:00
|
|
|
case "$ACTION" in
|
|
|
|
pressed)
|
|
|
|
wait_setup_mode &
|
|
|
|
PID=$!
|
|
|
|
echo $PID > /tmp/.wait_setup_mode
|
|
|
|
;;
|
|
|
|
released)
|
|
|
|
if [ -r /tmp/.wait_setup_mode ]; then
|
2019-09-30 19:38:40 +00:00
|
|
|
kill "$(cat /tmp/.wait_setup_mode)"
|
2014-07-05 18:11:41 +00:00
|
|
|
rm /tmp/.wait_setup_mode
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|