more meaningful output

This commit is contained in:
George Danchev 2011-07-11 18:58:07 +00:00
parent 594b4a0ce3
commit 19daaa2b77

View File

@ -23,21 +23,22 @@ get_speeds() {
} }
get_devices() { get_devices() {
echo -e "\n${SELF}: Running: $RELENG_XORRISO -devices 2>/dev/null | grep \"\-dev\""
DEVICES=`$RELENG_XORRISO -devices 2>/dev/null | grep "\-dev"` DEVICES=`$RELENG_XORRISO -devices 2>/dev/null | grep "\-dev"`
NUM_DEV=`echo ${DEVICES} | wc -l` NUM_DEV=`echo ${DEVICES} | wc -l`
case "${NUM_DEV}" in case "${NUM_DEV}" in
0) 0)
echo -e "\n${SELF}: No drives found." echo -e "${SELF}: No drives found."
exit 1 exit 1
;; ;;
1) 1)
echo -e "\n${SELF}: Single drive found:\n${DEVICES}" echo -e "${SELF}: Single drive found:\n${DEVICES}"
OUTDEV=`${RELENG_XORRISO} -devices 2>/dev/null | perl -pe "s#^\d+\s+\-dev\s+\'## and s#\'.*##"` OUTDEV=`${RELENG_XORRISO} -devices 2>/dev/null | perl -pe "s#^\d+\s+\-dev\s+\'## and s#\'.*##"`
get_speeds ${OUTDEV} get_speeds ${OUTDEV}
;; ;;
*) *)
echo -e "\n${SELF}: Multiple drives found. NOT FINISHED YET." echo -e "${SELF}: Multiple drives found. NOT FINISHED YET."
exit 2 exit 2
;; ;;
esac esac