X-Git-Url: https://git.gag.com/?p=debian%2Famanda;a=blobdiff_plain;f=changer-src%2Fchg-zd-mtx.sh.in;h=281112cd5449f16dc734ce8768b214c31f0c9b35;hp=db25d10ae4a0b6196bd23c8fc08176595ae708a8;hb=34197d9f46a5f4e944378cbb65fca32ee0eec7b9;hpb=71325c297e0436e9930a3e129a26696e78c27f62 diff --git a/changer-src/chg-zd-mtx.sh.in b/changer-src/chg-zd-mtx.sh.in index db25d10..281112c 100644 --- a/changer-src/chg-zd-mtx.sh.in +++ b/changer-src/chg-zd-mtx.sh.in @@ -68,6 +68,7 @@ # Storage Element 7:Full :VolumeTag=SR0007 # Storage Element 8:Full :VolumeTag=SR0008 # Storage Element 9:Full :VolumeTag=SR0009 +# Storage Element 10 IMPORT/EXPORT:Full :VolumeTag=SR0009 # # This says the first storage slot (element) is "1" and the last # is "9". If you allocate the entire robot to Amanda, you do not need @@ -502,6 +503,14 @@ get_loaded_info() { s/.*Storage Element \([0-9][0-9]*\):Full/-2/p q } + /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Empty/ { + s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p + q + } + /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Full/ { + s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/-2/p + q + } } ' < $mtx_status 2>& 1` shift # get rid of the "x" @@ -519,6 +528,10 @@ get_loaded_info() { s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p q } + /^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/ { + s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p + q + } } ' < $mtx_status 2>& 1` shift # get rid of the "x" @@ -571,6 +584,9 @@ get_slot_list() { /^.*Storage Element \([0-9][0-9]*\):Full/ { s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p } +/^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/ { + s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full.*/\1/p +} ' < $mtx_status 2>&1 | grep -v "^${cleanslot}\$" | sort -n` slot_list=`echo $slot_list` # remove the newlines if [ $firstslot -lt 0 -o $lastslot -lt 0 ]; then @@ -667,6 +683,9 @@ elif [ $TAPE = "/dev/null" ]; then fi export TAPE # for mtx command +CHANGER=$TAPE +export CHANGER # for mtx command + #### Set up the various config files. conf_match=`expr "$changerfile" : .\*\.conf\$` @@ -688,6 +707,11 @@ labelfile=$changerfile-barcodes cleancount=`cat $cleanfile` accesscount=`cat $accessfile` +test -z "$MT" && Exit 2 "" "No mt command defined" +test ! -f "$MT" && Exit 2 "" "mt command ($MT) doesn't exist" +test -z "$MTX" && Exit 2 "" "No mtx command defined" +test ! -f "$MTX" && Exit 2 "" "mtx command ($MTX) doesn't exist" + #### Dig out of the config file what is needed varlist=