summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-16 11:06:59 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-06-16 03:55:06 +0200
commit72953b1eb8fa42257c7f8eff603e04c953fac361 (patch)
treeafa98fe501440c6bc677bd61aeee5bf6864b761a /source4
parent7a723c6b386513ce58fe27469440bfc71debf685 (diff)
downloadsamba-72953b1eb8fa42257c7f8eff603e04c953fac361.tar.gz
samba-72953b1eb8fa42257c7f8eff603e04c953fac361.tar.bz2
samba-72953b1eb8fa42257c7f8eff603e04c953fac361.zip
selftest: Add targetdir and tdbrestore parameters to undump.sh
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/selftest/provisions/undump.sh27
1 files changed, 22 insertions, 5 deletions
diff --git a/source4/selftest/provisions/undump.sh b/source4/selftest/provisions/undump.sh
index 07408b7ea6..7ffea3eff7 100755
--- a/source4/selftest/provisions/undump.sh
+++ b/source4/selftest/provisions/undump.sh
@@ -1,18 +1,35 @@
#!/bin/sh
# undump a provision directory
-[ "$#" -eq 1 ] || {
- echo "Usage: undump.sh <DIRECTORY>"
+[ "$#" -gt 0 ] || {
+ echo "Usage: undump.sh <DIRECTORY> [TARGETDIR] [TDBRESTORE]"
exit 1
}
+
+TDBRESTORE=tdbrestore
+[ "$#" -lt 3 ] || {
+ TDBRESTORE=$3
+}
+
+
dirbase="$1"
-for f in $(find $dirbase -name '*.dump'); do
- dname=$(dirname $f)
+
+TARGETDIR=`pwd`/$dirbase
+
+cd $dirbase
+
+[ "$#" -lt 2 ] || {
+ TARGETDIR=$2
+}
+
+for f in $(find . -name '*.dump'); do
+ dname=$TARGETDIR/$(dirname $f)
+ mkdir -p $dname
bname=$(basename $f .dump)
outname=$dname/$bname
echo "Restoring $outname"
rm -f $outname
- bin/tdbrestore $outname < $f || {
+ $TDBRESTORE $outname < $f || {
echo "Failed to restore $outname"
exit 1
}