]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/do_sed
Final changes
[bacula/bacula] / regress / scripts / do_sed
index 49cf3b41106483f0351c28096288d55f5f579aa6..e999a521fc17d301947e6aede325376c0cd4b6e9 100755 (executable)
@@ -1,7 +1,10 @@
 #!/bin/sh
 #
-if test $# != 1 ; 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"
@@ -17,14 +20,40 @@ echo "s%@working_dir@%${cwd}/working%g" >>${out}
 echo "s%@piddir@%${cwd}/working%g" >>${out}
 echo "s%@subsysdir@%${cwd}/working%g" >>${out}
 echo "s%@job_email@%${1}%g" >>${out}
+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
+sed -f ${out} ${cwd}/scripts/new-test-bacula-dir.conf.in >${cwd}/scripts/new-test-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/testa-bacula-dir.conf.in >${cwd}/scripts/testa-bacula-dir.conf
 sed -f ${out} ${cwd}/scripts/test-bacula-fd.conf.in >${cwd}/scripts/test-bacula-fd.conf
 sed -f ${out} ${cwd}/scripts/test-bacula-sd.conf.in >${cwd}/scripts/test-bacula-sd.conf
 sed -f ${out} ${cwd}/scripts/test-console.conf.in >${cwd}/scripts/test-console.conf
+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/bacula-sd-2tape.conf.in >${cwd}/scripts/bacula-sd-2tape.conf
+sed -f ${out} ${cwd}/scripts/cleanup-tape.in >${cwd}/scripts/cleanup-tape
+sed -f ${out} ${cwd}/scripts/cleanup-2tape.in >${cwd}/scripts/cleanup-2tape
+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 ${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
+
+# get proper SD tape definitions
+if test x`uname` = xLinux ; then \
+   cp -f scripts/linux_tape_options bin/tape_options ; \
+fi
+if test x`uname` = xFreeBSD ; then \
+   cp -f scripts/freebsd_tape_options bin/tape_options ; \
+fi
 
 rm -f ${out}
+rm -f /tmp/bac$$