diff --git a/docker-compose.yml b/docker-compose.yml index 2ba0a52..45fcfd5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,9 +24,9 @@ services: # USB passthrough # Format : like 'lsusb' is given - # Currently only one USB device is supported - #USB_VID_1: "0e8d" # vendor ID - #USB_PID_1: "7961" # product ID + # Currently only two USB devices are supported + #USB_1: "0bda:8153" + #USB_2: "0e8d:7961" ports: # Port 8006 is console tty web VNC diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index 6942ee4..3bb0e65 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -169,12 +169,25 @@ fi # Attach USB interface USB_ARGS="" -if [[ -z "${USB_VID_1}" || -z "${USB_PID_1}" ]]; then - USB_ARGS="" +USB_1_ARGS="" +USB_2_ARGS="" +if [[ -z "${USB_1}" ]]; then + USB_1_ARGS="" else - USB_ARGS="-device usb-host,vendorid=0x$USB_VID_1,productid=0x$USB_PID_1" + USB_VID_1=$(echo $USB_1 | cut -d':' -f1) + USB_PID_1=$(echo $USB_1 | cut -d':' -f2) + USB_1_ARGS="-device usb-host,vendorid=0x$USB_VID_1,productid=0x$USB_PID_1" fi +if [[ -z "${USB_2}" ]]; then + USB_2_ARGS="" +else + USB_VID_2=$(echo $USB_2 | cut -d':' -f1) + USB_PID_2=$(echo $USB_2 | cut -d':' -f2) + USB_2_ARGS="-device usb-host,vendorid=0x$USB_VID_2,productid=0x$USB_PID_2" +fi + +USB_ARGS="${USB_1_ARGS} ${USB_2_ARGS}" info "Booting image using $VERS..."