Saturday, October 20th 2018, 10:45am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to NAS Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.



Posts: 101

Location: Australia


Wednesday, February 1st 2012, 12:37am

Button Script For MBox

Button Script For MBox (and clones)

The OpenWRT port for the MBox has the hotplug package installed by default.
This package can provide for button control by simple scripts in the /etc/hotplug.d/button/

In this folder there is already a script called 01-button (with commented out lines).
Replace the contents of this script with the code below, to set the upper button for a
firmware shutdown and the lower button for a system reboot



if [ "$BUTTON" = "BTN_0" ] && [ "$ACTION" = "released" ] && [ $SEEN -gt "5" ] ; then
exec kill -USR1 1
if [ "$BUTTON" = "BTN_1" ] && [ "$ACTION" = "released" ] && [ $SEEN -gt "5" ] ; then

End Code:

There is more information on the OpenWRT site (, including a script called
"Atheros' 00-button + UCI" that integrates button control into the UCI system. This script works fine on the MBox.