procd: make the preinit rules wildcard all buttons for failsafe
authorJohn Crispin <john@openwrt.org>
Mon, 10 Jun 2013 08:24:44 +0000 (08:24 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 10 Jun 2013 08:24:44 +0000 (08:24 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 36896

package/base-files/files/lib/preinit/30_failsafe_wait
package/procd/files/hotplug-preinit.json

index 5d6def72ac3a25fb9a832aa0a8c19ff3651eba28..3c5ece9f76f8049845fc498f1ffac57eb89561c2 100644 (file)
@@ -78,8 +78,9 @@ failsafe_wait() {
       pi_failsafe_net_message=true
       preinit_net_echo "Please press button now to enter failsafe"
       pi_failsafe_net_message=false
-      fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE
-      [ -f "/tmp/failsafe_button" ] && FAILSAFE=true && export FAILSAFE && rm /tmp/failsafe_button
+      fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true
+      [ -f "/tmp/failsafe_button" ] && FAILSAFE=true
+      [ "$FAILSAFE" = "true" ] && export FAILSAFE && touch /tmp/failsafe
     fi
 }
 
index d212b22fac33e4a70ba501dfff3e4cee10705e17..614b1047115b261ec74466b2de5303b4750dcfb4 100644 (file)
@@ -14,7 +14,6 @@
        [ "if",
                [ "and",
                        [ "eq", "SUBSYSTEM", "button" ],
-                       [ "eq", "BUTTON", "reset" ],
                ],
                [ "exec", "/etc/rc.button/failsafe" ]
        ],