]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/scripts/mtx-changer.in
ebl Ok in the current trunk
[bacula/bacula] / bacula / scripts / mtx-changer.in
index 1fe5f003bedc0f1f12ac757e903df5d8495ed482..60630a5531e8aeb8dba60eca7cb40a88736c39b4 100644 (file)
@@ -57,6 +57,8 @@ OS=`uname`
 case ${OS} in
   SunOS)
     ready="No Additional Sense"
+    # Sun sed/awk etc are not sufficient, working versions are in /usr/xpg4/bin
+    export PATH="/usr/local/sbin:/usr/local/bin:/usr/sfw/bin:/usr/xpg4/bin:/usr/bin"
     ;;
   FreeBSD)
     ready="Current Driver State: at rest."
@@ -108,7 +110,7 @@ make_temp_file() {
 wait_for_drive() {
   i=0 
   while [ $i -le 300 ]; do  # Wait max 300 seconds
-    if mt -f $1 status | grep ${ready} >/dev/null 2>&1; then
+    if mt -f $1 status 2>&1 | grep "${ready}" >/dev/null 2>&1; then
       break
     fi
     debug "Device $1 - not ready, retrying..."
@@ -124,7 +126,7 @@ check_parm_count() {
     pCountNeed=$2
     if test $pCount -lt $pCountNeed; then
        echo "usage: mtx-changer ctl-device command [slot archive-device drive-index]"
-       echo "  Insufficient number of arguments arguments given."
+       echo "  Insufficient number of arguments given."
        if test $pCount -lt 2; then
            echo "  Mimimum usage is first two arguments ..."
        else