Posted: Tue Nov 17, 2020 18:46 Post subject: Script to Switch On/Off USB Power
Is there a command line way to enable/disable "Core USB Support" (instead of doing this in the Services' USB menu through the web interface)?
I'd like to switch on and off a USB connected device (which only needs 5V power, not data) with a script runnning on the router. The router is Netgear R6400.
Thanks for teaching me about init. I can now switch on the USB with:
nvram set usb_enable=1
/sbin/init
But, that multiplies my init, hotplug2, start_service_f, and "sh .rc_startup" processes (and multiplies processes called within my startup script). By the way, even "kill -9 1" fails to kill init.
Then, after two toggles of the USB this way, the router crashed, rebooted itself, and worse yet, all nvram was gone (but at least DD-WRT firmware was still present). So, this is not looking good...anybody have a cleaner way or see a mistake I'm making?