Thanks for the idea Alzahao! I’ve been looking around for a way to implement, I saw that you had mentioned in another post to start/stop usb I would have to use the following:
ls /sys/class/leds/ usbpow
Then control the USB power using it
echo 0 > /sys/class/leds/…usbpow…/brightness
echo 1 > /sys/class/leds/…usbpow…/brightness
The below works, but for some reason it doesn’t work on reboot. I have to manually remove and reconnect the device although I’ve also added the @reboot sh checkInternet
if nc -zw1 google.com 443; then
echo "we have connectivity"
else
echo "resetting usb"
echo 1 > /sys/class/leds/…usbpow…/brightness
echo 0 > /sys/class/leds/…usbpow…/brightness
fi
thanks again,
T