if [ -n "$DEVICE" ] ; then
# is it a removable device?
[ "$(cat /sys/block/${DEVICE}/removable 2>/dev/null)" = "1" ] && REMOVABLE=true
# is it a usb device?
readlink /sys/block/${DEVICE} 2>/dev/null | grep -q '/usb' && USB_DEVICE=true
if [ -n "$DEVICE" ] ; then
# is it a removable device?
[ "$(cat /sys/block/${DEVICE}/removable 2>/dev/null)" = "1" ] && REMOVABLE=true
# is it a usb device?
readlink /sys/block/${DEVICE} 2>/dev/null | grep -q '/usb' && USB_DEVICE=true