]> git.sur5r.net Git - bacula/bacula/commitdiff
FreeBSD cleanups
authorKern Sibbald <kern@sibbald.com>
Thu, 2 Oct 2003 07:23:29 +0000 (07:23 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 2 Oct 2003 07:23:29 +0000 (07:23 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@720 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/do_sed
regress/tests/two-volume-tape
regress/tests/weird-files2-test

index 165a20484aaab6cb50a0582ee178829d19c5ea7a..097da5471f1f697dd7fccf3b0922da45096d7645 100755 (executable)
@@ -1,9 +1,10 @@
 #!/bin/sh
 #
-if test $# != 3 ; then
+if test $# != 4 ; then
    echo "First arg must be email name"
    echo "  and the second must be a tape drive"
    echo "  and the third must be a tape control name or /dev/null"
+   echo "  and the fourth must be the full path to the mtx program"
    exit 1
 fi
 out="/tmp/sed_tmp"
@@ -23,6 +24,7 @@ echo "s%@tape_drive@%${2}%g" >>${out}
 echo "s%@autochanger@%${3}%g" >>${out}
 echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
 echo "s%@hostname@%${host}%g" >>${out}
+echo "s%@changer_path@%${4}%g" >>${out}
 
 # process .in files with sed script
 sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
@@ -33,9 +35,14 @@ sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.c
 sed -f ${out} ${cwd}/scripts/bacula-dir-tape.conf.in >${cwd}/scripts/bacula-dir-tape.conf
 sed -f ${out} ${cwd}/scripts/bacula-sd-tape.conf.in >${cwd}/scripts/bacula-sd-tape.conf
 sed -f ${out} ${cwd}/scripts/cleanup-tape.in >${cwd}/scripts/cleanup-tape
+sed -f ${out} ${cwd}/scripts/prepare-two-tapes.in >${cwd}/scripts/prepare-two-tapes
 cp ${cwd}/bin/bacula-sd.conf /tmp/bac$$
 sed s%/tmp%${cwd}/tmp%g /tmp/bac$$ >${cwd}/bin/bacula-sd.conf
-chmod 777 ${cwd}/scripts/cleanup-tape
+chmod 777 ${cwd}/scripts/cleanup-tape ${cwd}/scripts/prepare-two-tapes
+rm -f /tmp/bac$$
+cp ${cwd}/bin/mtx-changer /tmp/bac$$
+sed "s%^MTX.*$%MTX=${4}%g" /tmp/bac$$ >${cwd}/bin/mtx-changer
+chmod 777 ${cwd}/bin/mtx-changer
 
 rm -f ${out}
 rm -f /tmp/bac$$
index 31c7d795eaa46bdb8a47bcaa6e96f1ce2c42a288..95047bee0851461b2fb74a97bfd1ffe5a8b26679 100755 (executable)
@@ -6,15 +6,7 @@
 cwd=`pwd`
 bin/bacula stop  2>&1 >/dev/null
 scripts/copy-tape-confs
-mtx -f /dev/sg0 unload
-mtx -f /dev/sg0 load 1
-mt -f /dev/nst0 rewind
-mt -f /dev/nst0 weof
-mtx -f /dev/sg0 unload
-mtx -f /dev/sg0 load 2
-mt -f /dev/nst0 rewind
-mt -f /dev/nst0 weof
-mtx -f /dev/sg0 unload
+scripts/prepare-two-tapes
 echo "${cwd}/build" >/tmp/file-list
 bin/drop_sqlite_tables
 bin/make_sqlite_tables
index a618c4e4c06b46a26b9caf73c7581a3df059e8d3..fdb4dd29b4251ef9143467ce5cc1f3530ef4937e 100755 (executable)
@@ -12,7 +12,7 @@ cwd=`pwd`
 scripts/copy-test-confs
 scripts/cleanup
 rm -rf weird-files2
-cp -a weird-files weird-files2
+cp -Rp weird-files weird-files2
 echo "${cwd}/weird-files2" >/tmp/file-list
 bin/bacula stop 2>&1 >/dev/null
 bin/drop_sqlite_tables