First, read the key mapping and logs for the device to confirm the presence of a dedicated WPS or user key. Retain the original reset and failure recovery capabilities. Design a key operation that can be triggered repeatedly with clear state indication, for example, disabling forwarding for a protected subnet.
Test short press and long press in experimental environment
Receive press, release, and duration events from button scripts in OpenWrt, using locks to prevent concurrent execution of multiple actions. Switching affects only the specified network, consistent with VPN disconnection policies; wired management remains always accessible. Use LED indicators or logs to show entry and exit states.
Check the terminal output

Confirm protected scope and reset entry via local switch
First, on a backup machine, check the event corresponding to the button press, and ensure wired management and recovery methods are available. Press briefly to trigger a test, then inspect the protected network and regular network separately. After reboot, verify the current status again.
Press the button under normal VPN conditions, when the peer disconnects, and during boot-up to re-establish the client request confirmation for the outbound path. After removing the newly added script, test that the original button handling functions correctly.
The button action only modifies the predefined network policies. If the action affects device reset or cannot be reversed, first remove the test script before restoring the original button behavior.
Comments