mirror of
https://github.com/samba-team/samba.git
synced 2025-01-06 13:18:07 +03:00
df29b9ab16
shfmt -f source4/selftest/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
48 lines
766 B
Bash
Executable File
48 lines
766 B
Bash
Executable File
#!/bin/sh
|
|
# dump a provision directory
|
|
|
|
[ "$#" -gt 0 ] || {
|
|
echo "Usage: dump.sh <DIRECTORY> [TARGETDIR] [TDBDUMP]"
|
|
exit 1
|
|
}
|
|
|
|
TDBDUMP=tdbdump
|
|
[ "$#" -lt 3 ] || {
|
|
TDBDUMP=$3
|
|
}
|
|
|
|
dirbase="$1"
|
|
|
|
TARGETDIR=$(pwd)/$dirbase
|
|
|
|
cd $dirbase
|
|
|
|
[ "$#" -lt 2 ] || {
|
|
TARGETDIR=$2
|
|
}
|
|
|
|
for f in $(find . -name '*.tdb'); do
|
|
dname=$TARGETDIR/$(dirname $f)
|
|
mkdir -p $dname
|
|
outname=$dname/$(basename $f).dump
|
|
echo "Dumping $f to $outname"
|
|
$TDBDUMP $f >$outname || {
|
|
echo "Failed to dump to $outname"
|
|
exit 1
|
|
}
|
|
rm -f $f
|
|
done
|
|
|
|
for f in $(find . -name '*.ldb'); do
|
|
dname=$TARGETDIR/$(dirname $f)
|
|
mkdir -p $dname
|
|
outname=$dname/$(basename $f).dump
|
|
echo "Dumping $f to $outname"
|
|
$TDBDUMP $f >$outname || {
|
|
echo "Failed to dump to $outname"
|
|
exit 1
|
|
}
|
|
rm -f $f
|
|
done
|
|
exit 0
|