X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fscripts%2Fmtx-changer.in;h=82e85f970801824f066cd9e35542be36d1f8d959;hb=8447702aeae6988598fdff0ab22ee0ee81c8727a;hp=ddc04e85cd19896632a0110cdd5d74a74a077fd3;hpb=aa846300170ee8a1fe984115e28d49d1d9857205;p=bacula%2Fbacula diff --git a/bacula/scripts/mtx-changer.in b/bacula/scripts/mtx-changer.in index ddc04e85cd..82e85f9708 100644 --- a/bacula/scripts/mtx-changer.in +++ b/bacula/scripts/mtx-changer.in @@ -36,6 +36,24 @@ MTX=@MTX@ +# mt status output +# SunOS No Additional Sense +# FreeBSD Current Driver State: at rest. +# Linux ONLINE + +OS=`uname` +case ${OS} in + SunOS) + ready="No Additional Sense" + ;; + FreeBSD) + ready="Current Driver State: at rest." + ;; + *) + ready="ONLINE" + ;; +esac + # # log whats done # @@ -72,11 +90,13 @@ make_temp_file() { # Note, this is very system dependent, so if you are # not running on Linux, you will probably need to # re-write it, or at least change the grep target. +# We've attempted to get the appropriate OS grep targets +# in the code at the top of this script. # wait_for_drive() { i=0 while [ $i -le 300 ]; do # Wait max 300 seconds - if mt -f $1 status | grep ONLINE >/dev/null 2>&1; then + if mt -f $1 status | grep ${ready} >/dev/null 2>&1; then break fi debug "Device $1 - not ready, retrying..."