1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#!/bin/sh
# bootcdmkbackupwiz
#
# Create a tar package with all files needed to backup
# a debian or alien linux distribution.
# Alternatively you can download a prebuild tar package with:
# wget ftp://bootcd.alioth.debian.org/pub/bootcd/bootcdbackupwizard.tar.gz
#
# Please see README.Debian for more info
set -e
VERSION=##BOOTCD.VERSION##
D="bootcdbackwiztar"
usage()
{
echo "Usage: bootcdmkbackwiztar [-f]" >&2
}
err()
{
echo "$*" >&2
exit 1
}
FORCE=""
while [ $# -ge 1 ]; do
if [ "$1" = "-f" ]; then
FORCE="1"
shift
else
usage "Unknown argument <$1>"
exit 1
fi
done
[ -e "$D" -a ! "$FORCE" ] && err "$D already exists. Please move it away and run again"
rm -rf $D
mkdir $D
(
cd $D
apt-get source bootcd
(
[ ! -d bootcd-${VERSION} ] && err "apt-get source bootcd did not install the VERSION ${VERSION}, please change /etc/apt/sources.list"
cd bootcd-${VERSION}
debuild binary
make bootcdbackwiz
)
)
cp $D/bootcd-${VERSION}/bootcdbackupwizard_${VERSION}.tar.gz .
rm -r $D
echo "created bootcdbackupwizard_${VERSION}.tar.gz"
|