Folks I have a usb bluetooth dongle which only works after I remove and re-attach it, can I mount un-mount it from command line to have it to be programmatically re-attached?
#!/bin/bash #Restart all USB devices #/usr/local/bin/restart_usb.sh set -euo pipefail IFS=$'\n\t' VENDOR="****" PRODUCT="****" for DIR in $(find /sys/bus/usb/devices/ -maxdepth 1 -type l); do if [[ -f $DIR/idVendor && -f $DIR/idProduct && $(cat $DIR/idVendor) == $VENDOR && $(cat $DIR/idProduct) == $PRODUCT ]]; then echo 0 > $DIR/authorized sleep 2 echo 1 > $DIR/authorized fi done
There’s also a bluetooth restart service in the archive
Yeah I had seen those links, specially the stack exchange one. Still there is a small detail i’ve omitted by mistake its a Bluetooth dongle. Echoing as suggested:
sh -c "echo > 0 /sys/bus/usb/devices/1-13/authorized"
Did not work. Just found a better discussion in ask ubuntu:
Gonna try it tommorow
Guys I did not manage to make it work I sitll need to unplug and replug it. Can you give me some help?