[SOLVED]How to use physical buttons to "ifup a interface"?

Finally!!!, I got the button working as I want, if I "turn on" (pressed) the rfkill button the admin interface brings up, and if I "turn off" (released) the rfkill button, the admin interface brings down.

I've edited the rfkill script located at "/etc/rc.button" with this:

#!/bin/sh

if [ "$ACTION" = "pressed" ] && [ "$BUTTON" = "rfkill" ]; then
           ifup admin
fi

if [ "$ACTION" = "released" ] && [ "$BUTTON" = "rfkill" ]; then              
           ifdown admin
fi

Thank you so much guys for help to this newbie, this community is incredible.

2 Likes