I've got experience with this... `reboot` won't work, as it doesn't cut power, but if you can do `rtcwake -m off -s 30`, the power to the USB ports gets cut in between the computer being off and booting back up again.
(I even replace `reboot` with a script warning of this gotcha :) )
Caveat: this is with a typical x86 motherboard. Not all SBCs have RTCs needed to use rtcwake (e.g. RPi doesn't I think?)
(I even replace `reboot` with a script warning of this gotcha :) )
Caveat: this is with a typical x86 motherboard. Not all SBCs have RTCs needed to use rtcwake (e.g. RPi doesn't I think?)