X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fscripts%2Fmtx-changer.in;h=1dbc5b410f66dd3fcee010b28e7acf2675c945d4;hb=efaee52f003a97c4f73a89505417ecfbe9fcdeeb;hp=0b475a672dff6f769c16203169aed6fdeec7609a;hpb=c1bd474834890e0062206937c88374956d5ad334;p=bacula%2Fbacula diff --git a/bacula/scripts/mtx-changer.in b/bacula/scripts/mtx-changer.in index 0b475a672d..1dbc5b410f 100644 --- a/bacula/scripts/mtx-changer.in +++ b/bacula/scripts/mtx-changer.in @@ -52,6 +52,10 @@ MTX=@MTX@ # SunOS No Additional Sense # FreeBSD Current Driver State: at rest. # Linux ONLINE +# Note Debian has a different mt than the standard Linux version. +# When no tape is in the drive it waits 2 minutes. +# When a tape is in the drive, it prints user unfriendly output. +# OS=`uname` case ${OS} in @@ -61,8 +65,12 @@ case ${OS} in FreeBSD) ready="Current Driver State: at rest." ;; - *) - ready="ONLINE" + Linux) + if test -e /etc/debian_version ; then + ready="drive status" + else + ready="ONLINE" + fi ;; esac @@ -108,7 +116,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..."