CLIENT=$(hostname)
SOURCE=${SOURCE:-/home /etc}
+WORKDIR=/var/lib/etc-obnam
function check_host() {
local type=$1
return 0
}
+function capture_debconf_info() {
+ # Keep a list of the installed files
+ dpkg --get-selections > $WORKDIR/installed.packages.new
+ if [ $? -eq 0 ]; then
+ mv $WORKDIR/installed.packages.new $WORKDIR/installed.packages
+ else
+ rm -f $WORKDIR/installed.packages.new
+ fi
+
+ # Dump out the debconf database
+ debconf-get-selections > $WORKDIR/debconf.dump.new
+ if [ $? -eq 0 ]; then
+ mv $WORKDIR/debconf.dump.new $WORKDIR/debconf.dump
+ else
+ rm -f $WORKDIR/debconf.dump.new
+ fi
+}
+
+
if ( check_host 'AAAA' -o check_host 'A' )
then
- obnam --quiet --client-name=$CLIENT backup $SOURCE
+ capture_debconf_info
+
+ obnam --quiet --client-name=$CLIENT backup $WORKDIR $SOURCE
exit 0
else
echo huh, where is it?