I'm using image builder to build custom ROMs for ASUS RT-N16 routers. RT-N16 is a very good and robust hardware, readily available, reasonable priced and is capable to handle a lot of openvpn traffic. There is no problem to install custom image when router is sitting there, on my table. However my custom ROMs evolve over time and I need to upgrade routers installed in many remote places. And here is the problem: router requires manual reset after sysupgrade and first booting. And sometimes it's impossible to send a man to reset the router, sometimes it's better not to ask anybody to touch anything because they will screw up even simpliest task of pluggin' off and on...

Thus I need automatic reboot after router installation.

I tried to place reboot command at the end of my /etc/uci-defaults/setup.sh script. But this leads to endless reboot (does openwrt reboot twice and erase that script on second reboot?).

Here is a question: how to force the router to reboot after /etc/uci-defaults script finished and everything is ready without causing endless reboot loop?