]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/do_sed
Fix config of regexwhere-test
[bacula/bacula] / regress / scripts / do_sed
index 4c43e46d31a291379662082ba381d56b3cafccca..b502715ffa17701b864edf0e0b6f609ab4fdc388 100755 (executable)
@@ -1,41 +1,42 @@
 #!/bin/sh
 #
-if test $# != 6 ; 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"
-   echo "  and the fifth must be tape drive 1 or /dev/null"
-   echo "  and the sixth must be the smtp or email host"
-   exit 1
-fi
 cwd=`pwd`
+. ${cwd}/config
 mkdir -p ${cwd}/bin
 out="/tmp/sed_tmp"
-HOST="localhost"
 # Create sed command script
 echo "s%@sbindir@%${cwd}/bin%g" >${out}
 echo "s%@scriptdir@%${cwd}/bin%g" >>${out}
 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%@job_email@%${EMAIL}%g" >>${out}
+echo "s%@tape_drive@%${TAPE_DRIVE}%g" >>${out}
+echo "s%@autochanger@%${AUTOCHANGER}%g" >>${out}
 echo "s%@tmpdir@%${cwd}/tmp%g" >>${out}
 echo "s%@hostname@%${HOST}%g" >>${out}
-echo "s%@changer_path@%${4}%g" >>${out}
-echo "s%@tape_drive1@%${5}%g" >>${out}
-echo "s%@smtp_host@%${6}%g" >>${out}
+echo "s%@changer_path@%${AUTOCHANGER_PATH}%g" >>${out}
+echo "s%@tape_drive1@%${TAPE_DRIVE1}%g" >>${out}
+echo "s%@smtp_host@%${SMTP_HOST}%g" >>${out}
 echo "s%@disk_drive@%${cwd}/tmp/disk-changer%g" >>${out}
-
-echo "AUTOCHANGER=\"${3}\"" >config.out
-echo "TAPE_DRIVE1=\"${5}\"" >>config.out
-
+echo "s%@hostname@%${hostname}%g" >>${out}
+echo "s%@hostname1@%${hostname1}%g" >>${out}
+echo "s%@hostname2@%${hostname2}%g" >>${out}
+echo "s%@hostname3@%${hostname3}%g" >>${out}
+echo "s%@hostname1_files@%${hostname1_files}%g" >>${out}
+echo "s%@hostname_files@%${hostname_files}%g" >>${out}
+echo "s%@hostname2_files@%${hostname2_files}%g" >>${out}
+echo "s%@hostname3_files@%${hostname3_files}%g" >>${out}
+echo "s%@hostname1_password@%${hostname1_password}%g" >>${out}
+echo "s%@hostname2_password@%${hostname2_password}%g" >>${out}
+echo "s%@hostname3_password@%${hostname3_password}%g" >>${out}
 
 # process .in files with sed script
+sed -f ${out} ${cwd}/scripts/bacula-dir.conf.errors.in >${cwd}/scripts/bacula-dir.conf.errors
 sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.in >${cwd}/scripts/test-bacula-dir.conf
-sed -f ${out} ${cwd}/scripts/test-bacula-dir.conf.regexwhere.in >${cwd}/scripts/bacula-dir.conf.regexwhere
+sed -f ${out} ${cwd}/scripts/multi-client-bacula-dir.conf.in >${cwd}/scripts/multi-client-bacula-dir.conf
+sed -f ${out} ${cwd}/scripts/bacula-dir.conf.regexwhere.in >${cwd}/scripts/bacula-dir.conf.regexwhere
+sed -f ${out} ${cwd}/scripts/bacula-dir.conf.maxtime.in >${cwd}/scripts/bacula-dir.conf.maxtime
 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
@@ -59,12 +60,22 @@ sed -f ${out} ${cwd}/scripts/cleanup-2drive.in >${cwd}/scripts/cleanup-2drive
 sed -f ${out} ${cwd}/scripts/prepare-two-tapes.in >${cwd}/scripts/prepare-two-tapes
 sed -f ${out} ${cwd}/scripts/bacula-dir.conf.testrunscript.in >${cwd}/scripts/bacula-dir.conf.testrunscript
 
+sed -f ${out} ${cwd}/scripts/tls-bacula-fd.conf.in >${cwd}/scripts/tls-bacula-fd.conf
+sed -f ${out} ${cwd}/scripts/tls-bacula-sd.conf.in >${cwd}/scripts/tls-bacula-sd.conf
+sed -f ${out} ${cwd}/scripts/tls-bacula-dir.conf.in >${cwd}/scripts/tls-bacula-dir.conf
+
+sed -f ${out} ${cwd}/scripts/bacula-fd-2d.conf.in >${cwd}/scripts/bacula-fd-2d.conf
+sed -f ${out} ${cwd}/scripts/bacula-sd-2d.conf.in >${cwd}/scripts/bacula-sd-2d.conf
+sed -f ${out} ${cwd}/scripts/bacula-dir-2d.conf.in >${cwd}/scripts/bacula-dir-2d.conf
+sed -f ${out} ${cwd}/scripts/bconsole-2d.conf.in >${cwd}/scripts/bconsole-2d.conf
+
+
 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/cleanup-*drive ${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
+sed "s%^MTX.*$%MTX=${AUTOCHANGER_PATH}%g" /tmp/bac$$ >${cwd}/bin/mtx-changer
 chmod 777 ${cwd}/bin/mtx-changer
 
 # get proper SD tape definitions