There already exists support to run custom scripts when switching the Toggle Button on/off on routers with that button by placing an executable script in /etc/gl-switch.d/. Then the user can use uci to set switch-button.@main[0].func to the name of that script, or even use the official UI to select that value in the drop-down.
However, this is not documented at all in the Toggle Button docs. My request is for this to be officially documented, because:
- Documentation lets users know about this customization. I was going to request this feature before realizing it already exists!
- Official documentation would indicate that this feature will be supported going forwards, which lets users feel comfortable using it without worrying if an update will silently remove support for it.