# we print drive content seen by autochanger
# and we also remove loaded media from the barcode list
- for i in $dir/loaded*
- do
- d=${i##$dir/loaded}
- s=$(cat $i)
- v=$(awk -F: "/^$s:/"' { print $2 }' $dir/barcodes)
- echo "D:$d:F:$s:$v"
- echo "^$s:" >> $TMPFILE
+ i=0
+ while [ $i -le $maxdrive ]; do
+ if [ -f $dir/loaded${i} ]; then
+ ld=`cat $dir/loaded${i}`
+ v=`awk -F: "/^$ld:/"' { print $2 }' $dir/barcodes`
+ echo "D:$i:F:$ld:$$v"
+ echo "^$ld:" >> $TMPFILE
+ fi
+ i=`expr $i + 1`
done
# Empty slots are not in barcodes file
exit $rtn
;;
- listall)
+ listall)
+# Drive content: D:Drive num:F:Slot loaded:Volume Name
+# D:0:F:2:vol2 or D:Drive num:E
+# D:1:F:42:vol42
+# D:3:E
+#
+# Slot content:
+# S:1:F:vol1 S:Slot num:F:Volume Name
+# S:2:E or S:Slot num:E
+# S:3:F:vol4
+#
+# Import/Export tray slots:
+# I:10:F:vol10 I:Slot num:F:Volume Name
+# I:11:E or I:Slot num:E
+# I:12:F:vol40
+
debug "Doing mtx -f $ctl -- to list all"
make_temp_file
if test ${inventory} -ne 0 ; then
* S:2:E or S:Slot num:E
* S:3:F:vol4
*
+ * Import/Export tray slots:
+ * I:10:F:vol10 I:Slot num:F:Volume Name
+ * I:11:E or I:Slot num:E
+ * I:12:F:vol40
+ *
* If a drive is loaded, the slot *should* be empty
*
* Output:
* S|2||||||||
* S|3|3|vol4|15869952|Append|LTO1-ANSI|Inc|1250858907|1282394907
*
- * Type can be S or I (Slot or Import/Export)
- *
* TODO: need to merge with status_slots()
*/
void status_content(UAContext *ua, STORE *store)