diff --git a/luci/config-mode/files/etc/hotplug.d/button/50-config-mode b/luci/config-mode/files/etc/hotplug.d/button/50-config-mode new file mode 100755 index 0000000..9e28b6f --- /dev/null +++ b/luci/config-mode/files/etc/hotplug.d/button/50-config-mode @@ -0,0 +1,29 @@ +#!/bin/sh + + +wait=3 + + +wait_config_mode() { + sleep $wait + uci set 'config_mode.@wizard[0].enabled=1' + uci commit config_mode + reboot +} + + +if [ "$BUTTON" = wps ]; then + case "$ACTION" in + pressed) + wait_config_mode & + PID=$! + echo $PID > /tmp/.wait_config_mode + ;; + released) + if [ -r /tmp/.wait_config_mode ]; then + kill $(cat /tmp/.wait_config_mode) + rm /tmp/.wait_config_mode + fi + ;; + esac +fi