3 # Create two blank tapes
7 # SunOS No Additional Sense
8 # FreeBSD Current Driver State: at rest.
10 # Note Debian has an inferior mt. When no tape is in the
11 # drive it waits 2 minutes. When a tape is in the drive, it
12 # prints user unfriendly output.
18 ready="No Additional Sense"
21 ready="Current Driver State: at rest."
24 if test -e /etc/debian_version ; then
34 while [ $i -le 300 ]; do # Wait max 300 seconds
35 if mt -f $1 status 2>&1 | grep "${ready}" >/dev/null 2>&1; then
38 # debug "Device $1 - not ready, retrying..."
45 # mt -f @tape_drive@ offline
46 @changer_path@ -f @autochanger@ unload
47 @changer_path@ -f @autochanger@ load 1
48 wait_for_drive @tape_drive@
49 mt -f @tape_drive@ rewind
50 mt -f @tape_drive@ weof
51 @changer_path@ -f @autochanger@ unload
52 @changer_path@ -f @autochanger@ load 2
53 wait_for_drive @tape_drive@
54 mt -f @tape_drive@ rewind
55 mt -f @tape_drive@ weof
56 #@changer_path@ -f @autochanger@ unload