Imported Upstream version 3.1.0
[debian/amanda] / changer-src / chg-zd-mtx.sh
index dd26273daf9cdc607b6a35c0d3f2eb55d62c4f4f..84c8f85697145a2e5cd3a59860e27cc06ef1f9d3 100644 (file)
@@ -1220,10 +1220,17 @@ loadslot() {
                shift
        done
        if [ $# -le 0 ]; then
-               Exit 2 \
-                    `_ '<none>'` \
-                    `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"`
-               return $?                       # in case we are internal
+               if [ $find_slot -ge $firstslot -a $find_slot -le $lastslot ]; then
+                       Exit 2 \
+                            `_ '<none>'` \
+                            `_ 'Cannot find a tape in slot %s' "$find_slot "`
+                       return $?                       # in case we are internal
+               else
+                       Exit 2 \
+                            `_ '<none>'` \
+                            `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"`
+                       return $?                       # in case we are internal
+               fi
        fi
 
        # Determine the slot to load.
@@ -1474,7 +1481,7 @@ searchtape() {
        if [ $labelfile_entry_found -eq 0 ]; then
                LogAppend `_ '         -> !!! label "%s" not found in %s !!!' "$tapelabel" "$labelfile"`
                LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
-               Exit 2 \
+               Exit 1 \
                     `_ '<none>'` \
                     `_ '%s: label "%s" not found in %s' "$tapelabel" "$tapelabel" "$labelfile"`
                return $?                       # in case we are internal
@@ -1497,7 +1504,7 @@ searchtape() {
        if [ -z "$foundslot" ]; then
                LogAppend `_ 'ERROR    -> !!! Could not find slot for barcode "%s"!!!' "$labelfile_barcode"`
                LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
-               Exit 2 \
+               Exit 1 \
                     `_ '<none>'` \
                     `_ 'barcode "%s" not found in mtx status output' "$labelfile_barcode"`
                return $?                       # in case we are internal