fi
out="/tmp/sed_tmp"
cwd=`pwd`
-host=`hostname | tr '.' ' ' | cut -f 1 -d ' '`
-if test x$host = x ; then
- host=localhost
-fi
-host="localhost"
+HOST="localhost"
# Create sed command script
echo "s%@sbindir@%${cwd}/bin%g" >${out}
echo "s%@scriptdir@%${cwd}/bin%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%@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}
quit
END_OF_DATA
+# run backup
if test "$debug" -eq 1 ; then
bin/bacula start
cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
scripts/check_for_zombie_jobs storage=File1
bin/bacula stop 2>&1 >/dev/null
echo "volume=TestVolume001|TestVolume002" >tmp/bscan.bsr
-bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
-#bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
-bin/bacula start 2>&1 >/dev/null
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
-#bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
+
+if test "$debug" -eq 1 ; then
+ bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
+else
+ bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >/dev/null
+fi
+
+cat <<END_OF_DATA >tmp/bconcmds
@$out /dev/null
messages
@$out tmp/log2.out
@#
@# now do a restore
@#
+@#setdebug level=400 storage=File1
restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
yes
wait
@$out
quit
END_OF_DATA
+
+# now run restore
+if test "$debug" -eq 1 ; then
+ bin/bacula start
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
+else
+ bin/bacula start 2>&1 >/dev/null
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
+fi
+
+
scripts/check_for_zombie_jobs storage=File1
bin/bacula stop 2>&1 >/dev/null
grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null