#!/bin/sh # # Copyright (C) 2000-2017 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # This script will prepare a big dummy autochanger # . scripts/functions adir=@working_dir@/ach rm -rf $adir mkdir $adir 2> /dev/null # work with $1 slots by default nb_slot=${1:-80} # create the autochanger configuration file cat > $adir/conf < /dev/null sed -i 's/test -c /test -f/g' $bin/storage2-ctl 2> /dev/null # create generic device for bsg_persist for i in `seq 0 8`; do touch $adir/sg$i c done nb_vol=`expr $nb_slot - 5` # create $nb_vol volumes for i in `seq 1 $nb_vol`; do echo $i:vol$i >> $adir/barcodes cp /dev/null $adir/slot$i done # make a cleaning tape cln_slot=`expr $nb_vol + 1` echo $cln_slot:CLN01 >> $adir/barcodes cp /dev/null $adir/slot$cnl_slot # keep other empty next_empty=`expr $cnl_slot + 1` for i in `seq $next_empty $nb_slot`; do echo $i: >> $adir/barcodes done