The button active the script /etc/rc.button/reset

The switch active the script /etc/rc.button/BTN_8

just edit this two files, you can find the clue. Here is a post for same applications.