#
# Copyright (C) 2000-2015 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#
#
# This file is sourced by the mtx-changer script every time it runs.
#   You can put your site customization here, and when you do an
#   upgrade, the process should not modify this file.  Thus you
#   preserve your mtx-changer configuration.
#

# We update the version when an incompatible change 
#   to mtx-changer or this conf file is made, such as
#   adding a new required variable.
version=2

# Set to 1 if you want to do offline before unload
offline=0

# Set to amount of time in seconds to wait after an offline
offline_sleep=0

# Set to amount of time in seconds to wait after a load
load_sleep=0

# Set to 1 to do an inventory before a status. Not normally needed. 
inventory=0

# If you have a VXA PacketLoader, it might display a different 
#  Storage Element line, so try setting the following to 1
vxa_packetloader=0

#
# Debug logging
#

# If you have multiple SD's, set this differently for each one
#  so you know which message comes from which one. This can
#  be any string, and will appear in each debug message just
#  after the time stamp.
chgr_id=0

# Set to 1 if you want debug info written to a log
debug_log=0

# Set to debug level you want to see 
#     0 is off 
#    10 is important events (load, unload, loaded)
#   100 is everything
# Note debug_log must be set to 1 for anything to be generated
#
debug_level=10  

# Debug levels by importance
#  Normally you do not need to change this
dbglvl=100
# More important messages
idbglvl=10

#
# mt status output
# 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.
#  Note, with Ubuntu Gusty (8.04), there are two versions of mt,
#    so we attempt to figure out which one.
#  Note, with mt GNU cpio, we use "drive status" output
#

OS=`uname`
case ${OS} in
  SunOS)
    ready="No Additional Sense"
    ;;
  FreeBSD)
    ready="Current Driver State: at rest."
    ;;
  Linux)
    ready="ONLINE"
    if test -f /etc/debian_version ; then
       mt --version|grep "mt-st" >/dev/null 2>&1
       if test $? -eq 1 ; then
          ready="drive status"
       fi
    else
        mt --version|grep "GNU cpio" >/dev/null 2>&1
        if test $? -eq 0 ; then
           ready="drive status"
        fi
    fi
  ;;
esac
