]> git.sur5r.net Git - bacula/bacula/commitdiff
More scripting stuff
authorKern Sibbald <kern@sibbald.com>
Sun, 10 May 2009 08:31:39 +0000 (08:31 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 10 May 2009 08:31:39 +0000 (08:31 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8819 91ce42f0-d328-0410-95d8-f526ca767f89

regress/scripts/do_sed
regress/scripts/functions

index 2c1c2280c77320270d72e837f2f03d9d25edb454..7de1d869217f17a2397b65d4ba063c7e9986e314 100755 (executable)
@@ -72,9 +72,9 @@ chmod 755 ${rscripts}/regress-config
 cp ${rscripts}/win32-bacula-sd-tape.conf.in ${rscripts}/win32-bacula-sd-tape.conf
 cp ${rscripts}/win32-bacula-fd.conf.in      ${rscripts}/win32-bacula-fd.conf
 
-if test -f ${scripts}/bacula-sd.conf ; then
-  cp ${scripts}/bacula-sd.conf ${tmp}/bac$$
-  sed "s% /tmp%${tmp}%g" ${tmp}/bac$$ >${scripts}/bacula-sd.conf
+if test -f ${conf}/bacula-sd.conf ; then
+  cp ${conf}/bacula-sd.conf ${tmp}/bac$$
+  sed "s% /tmp%${tmp}%g" ${tmp}/bac$$ >${conf}/bacula-sd.conf
 fi
 chmod 755 ${rscripts}/cleanup-*tape ${rscripts}/cleanup-*drive ${rscripts}/prepare-two-tapes 
 rm -f ${tmp}/tmp/bac$$
index 7c02a454ddc4d8f70a9102570bb3e119f06a0223..2940e0c5dd609753ddf8c942860834889f9b554e 100644 (file)
@@ -5,7 +5,7 @@
 
 check_encoding()
 {
-   ${bin}/bacula-dir -d50 -t -c ${scripts}/bacula-dir.conf 2>&1 | grep 'Wanted SQL_ASCII, got UTF8' >/dev/null
+   ${bin}/bacula-dir -d50 -t -c ${conf}/bacula-dir.conf 2>&1 | grep 'Wanted SQL_ASCII, got UTF8' >/dev/null
    if [ $? = 0 ]; then
        echo "Found database encoding problem, please modify the database encoding (SQL_ASCII)"
        exit 1
@@ -19,8 +19,8 @@ start_test()
    outf="${tmp}/sed_tmp"
    echo "s%  mail =%# mail = %g" >${outf}
    echo "s%  operator =%# operator =%g" >>${outf}
-   cp ${scripts}/bacula-dir.conf ${tmp}/1
-   sed -f ${outf} ${tmp}/1 > ${scripts}/bacula-dir.conf
+   cp ${conf}/bacula-dir.conf ${tmp}/1
+   sed -f ${outf} ${tmp}/1 > ${conf}/bacula-dir.conf
    echo " "
    echo " "
    echo " === Starting $TestName at `date +%R:%S` ==="
@@ -157,11 +157,11 @@ run_bacula()
      ${scripts}/bacula-ctl-sd start
      ${scripts}/bacula-ctl-fd start $1
      ${scripts}/bacula-ctl-dir start
-     cat ${tmp}/bconcmds | ${bin}/bconsole -c ${scripts}/bconsole.conf
+     cat ${tmp}/bconcmds | ${bin}/bconsole -c ${conf}/bconsole.conf
      return $?
    else
      ${bin}/bacula start >/dev/null 2>&1
-     cat ${tmp}/bconcmds | ${bin}/bconsole -c ${scripts}/bconsole.conf >/dev/null 2>&1
+     cat ${tmp}/bconcmds | ${bin}/bconsole -c ${conf}/bconsole.conf >/dev/null 2>&1
      return $?
    fi
 }
@@ -170,18 +170,18 @@ run_bconsole()
 {
    bconsole_file=${1:-${tmp}/bconcmds}
    if test "$debug" -eq 1 ; then
-     cat $bconsole_file | ${bin}/bconsole -c ${scripts}/bconsole.conf
+     cat $bconsole_file | ${bin}/bconsole -c ${conf}/bconsole.conf
    else
-     cat $bconsole_file | ${bin}/bconsole -c ${scripts}/bconsole.conf  2>&1 >/dev/null
+     cat $bconsole_file | ${bin}/bconsole -c ${conf}/bconsole.conf  2>&1 >/dev/null
    fi
 }
 
 run_btape()
 {
    if test "$debug" -eq 1 ; then
-     cat ${tmp}/bconcmds | ${bin}/btape -c ${scripts}/bacula-sd.conf DDS-4 | tee ${tmp}/log1.out
+     cat ${tmp}/bconcmds | ${bin}/btape -c ${conf}/bacula-sd.conf DDS-4 | tee ${tmp}/log1.out
    else
-     cat ${tmp}/bconcmds | ${bin}/btape -c ${scripts}/bacula-sd.conf DDS-4 >${tmp}/log1.out 2>&1
+     cat ${tmp}/bconcmds | ${bin}/btape -c ${conf}/bacula-sd.conf DDS-4 >${tmp}/log1.out 2>&1
    fi
 }
 
@@ -234,9 +234,9 @@ change_jobname()
       newname=$2
    fi
    rm -f ${bin}/1
-   mv ${scripts}/bacula-dir.conf ${bin}/1
+   mv ${conf}/bacula-dir.conf ${bin}/1
    echo "s%${oldname}%${newname}%g" >${tmp}/1
-   sed -f ${tmp}/1 ${bin}/1 >${scripts}/bacula-dir.conf
+   sed -f ${tmp}/1 ${bin}/1 >${conf}/bacula-dir.conf
 #  echo "Job ${oldname} changed to ${newname}"
 }
 
@@ -446,6 +446,9 @@ bin=${bin:-"$cwd/bin"}
 # Bacula scripts
 scripts=${scripts:-"$bin"}
 
+# Bacula conf files
+conf=${conf:-"$bin"}
+
 # Regress scripts
 rscripts=${rscripts:-"$cwd/scripts"}
 
@@ -459,6 +462,7 @@ src=${src:-"$cwd/build"}
 tmpsrc=${tmpsrc:-"$cwd/tmp/build"}
 
 export bin
+export conf
 export working
 export scripts
 export rscripts