#!/bin/bash

if [ -z $1 -o -z $2 ]; then
    echo "usbding vendor device"
    exit
fi

s=$(lsusb | grep "${1}:${2}")

bus=${s/Bus /}
dev=${bus/*Device /}
bus=${bus/ Device*/}
bus=$(expr $bus + 0)
dev=${dev/:*/}
dev=$(expr $dev + 0)

echo "-device usb-host,hostbus=${bus},hostaddr=${dev}"
