From cbc1a9723aa03f0b00d75d0ae64801bb7d37f9ec Mon Sep 17 00:00:00 2001 From: George Danchev Date: Tue, 12 Jul 2011 11:01:39 +0000 Subject: [PATCH] check exit status of all commands --- releng/manual_devices | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/releng/manual_devices b/releng/manual_devices index 546edd52..37175284 100755 --- a/releng/manual_devices +++ b/releng/manual_devices @@ -20,6 +20,16 @@ fi get_speeds() { echo -e "\n${SELF}: Running: ${RELENG_XORRISO} -outdev ${1} -list_speeds" ${RELENG_XORRISO} -outdev ${1} -list_speeds + RET_SPEEDS="$?" + case ${RET_SPEEDS} in + 0) + ;; + *) + boldify + echo -e "\n${SELF}: ${RELENG_XORRISO} -outdev ${1} -list_speeds returned ${RET_SPEEDS}." + unboldify + ;; + esac } get_devices() { @@ -47,17 +57,18 @@ get_devices() { # main echo -e "\n${SELF}: Running: $RELENG_XORRISO -devices..." $RELENG_XORRISO -devices -RET="$?" -case ${RET} in +RET_DEVICES="$?" +case ${RET_DEVICES} in 0) - get_devices - ;; + get_devices + ;; *) - boldify - echo -ne "\n${SELF}: ${RELENG_XORRISO} -devices returned ${RET}." - unboldify - echo -e "\n${SELF}: Already mounted?" - df -kh + boldify + echo -ne "\n${SELF}: ${RELENG_XORRISO} -devices returned ${RET_DEVICES}." + unboldify + echo -e "\n${SELF}: Already mounted?" + df -kh + ;; esac exit 0