blob: 831abfb6e32852ecfbc08edcdc63fe07d8b9dde6 [file]
#!/bin/bash
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#### CATEGORY=Other
### list attached usb disks
case "$(uname)" in
Linux)
for disk in $(ls /dev/disk/by-path/*-usb-* 2>/dev/null); do
if [[ "${disk}" =~ part ]]; then
continue
fi
disk=$(readlink -f "${disk}")
details="$(cat /sys/block/$(basename "${disk}")/device/model)"
echo "${disk} - ${details}"
done
;;
*)
echo "Unsupported platform $(uname)"
exit 1
;;
esac