summaryrefslogtreecommitdiff
path: root/source4/selftest/provisions/undump.sh
blob: 07408b7ea6b8419f4de3b9bb6f8cb1a2dcb98d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# undump a provision directory

[ "$#" -eq 1 ] || {
    echo "Usage: undump.sh <DIRECTORY>"
    exit 1
}
dirbase="$1"
for f in $(find $dirbase -name '*.dump'); do
    dname=$(dirname $f)
    bname=$(basename $f .dump)
    outname=$dname/$bname
    echo "Restoring $outname"
    rm -f $outname
    bin/tdbrestore $outname < $f || {
	echo "Failed to restore $outname"
	exit 1
    }
done
exit 0