]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/examples/autochangers/mtx-changer.Adic-Scalar-24
Tweak TRU64 xattr code.
[bacula/bacula] / bacula / examples / autochangers / mtx-changer.Adic-Scalar-24
index 8f0dc9d5803dfa7cd5eddc34344783da3e6e691f..70a7409eee2f1741b7df520565a45c0926abc1b6 100755 (executable)
@@ -6,7 +6,7 @@
 #
 #  If you set in your Device resource
 #
-#  Changer Command = "path-to-this-script/mtx-changer" %c %o %S %a %d
+#  Changer Command = "path-to-this-script/mtx-changer %c %o %S %a %d"
 #    you will have the following input to this script:
 #
 #  mtx-changer "changer-device" "command" "slot" "archive-device" "drive-index"
@@ -102,11 +102,12 @@ case $cmd in
       ;;
 
    loaded)
-      ${MTX} -f $ctl status >/tmp/mtx.$$
+      tempfile=`mktemp -t` || exit 33 
+      ${MTX} -f $ctl status > $tempfile
       rtn=$?
-      cat /tmp/mtx.$$ | grep "^Data Transfer Element $drive:Full" | awk '{print $7}'
-      cat /tmp/mtx.$$ | grep "^Data Transfer Element $drive:Empty" | awk '{print 0}'
-      rm -f /tmp/mtx.$$
+      cat $tempfile | grep "^Data Transfer Element $drive:Full"  | awk '{print $7}'
+      cat $tempfile | grep "^Data Transfer Element $drive:Empty" | awk '{print 0}'
+      rm -f $tempfile
       exit $rtn
       ;;