How to run a script in OpenWRT when rebooting system?

How to run a script in OpenWRT when rebooting system?

There's a scenario where a script needs to be run in Linux when rebooting to set GPIO for power reset. How can this be achieved?

Can you describe the situation a little more? Is the script supposed to precede the actual reboot (i.e. OpenWrt going down for reboot), or does it get executed as the system comes back up?

Is the script's action all local, or is it triggering something via the network?

Does it need to happen only when the "reboot" command is used, or whenever the device boots?

I found the solution. Thanks.

https://openwrt.org/docs/techref/process.boot?s=shutdown#init

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.