|
|
|
@ -39,7 +39,22 @@ case "${1}" in
|
|
|
|
|
done
|
|
|
|
|
sort -n -o /tmp/scsictl /tmp/scsictl
|
|
|
|
|
column -N H:C:I:L,PORT,DEV,SIZE,NAME -t -R1,4 -o" " /tmp/scsictl
|
|
|
|
|
rm /tmp/scsictl
|
|
|
|
|
;;
|
|
|
|
|
rm /tmp/scsictl;;
|
|
|
|
|
delete|rescan)
|
|
|
|
|
case "${2}" in
|
|
|
|
|
sd*)
|
|
|
|
|
if [ -e "/sys/class/block/${2}" ]; then
|
|
|
|
|
echo 1 | sudo tee "/sys/class/block/${2}/device/${1}" > /dev/null
|
|
|
|
|
else
|
|
|
|
|
echo "Device '${2}' not found."; exit 1
|
|
|
|
|
fi;;
|
|
|
|
|
[0-9]:*|[0-9][0-9]:*|[0-9][0-9][0-9]:*)
|
|
|
|
|
if [ -e "/sys/class/scsi_device/${2}" ]; then
|
|
|
|
|
echo 1 | sudo tee "/sys/class/scsi_device/${2}/device/${1}" > /dev/null
|
|
|
|
|
else
|
|
|
|
|
echo "Device '${2}' not found."; exit 1
|
|
|
|
|
fi;;
|
|
|
|
|
*) echo "Uknown device '${2}' -- expected sd[x] or n:n:n:n";;
|
|
|
|
|
esac;;
|
|
|
|
|
*) echo "Unknown verb '${1}' -- expected delete, list, or rescan"; exit 1;;
|
|
|
|
|
esac
|
|
|
|
|