summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalbackupconfig22
1 files changed, 19 insertions, 3 deletions
diff --git a/localbackupconfig b/localbackupconfig
index a9b1e25..8176da7 100755
--- a/localbackupconfig
+++ b/localbackupconfig
@@ -3,17 +3,33 @@
# /usr/local/sbin/localbackupconfig
# Copyright 2001 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localbackupconfig,v 1.1 2002-03-25 15:52:49 jonas Exp $
+# $Id: localbackupconfig,v 1.2 2002-03-29 12:59:48 jonas Exp $
+#
+# .dpkg-new files appear when refusing to update a conffile on package update
+#
+# .orig files you should save yourself before customizing a configfile
+#
+# .old files are for customizing when you don't have the original (anymore)
#
FQDN=`hostname -f`
BACKUPDIR=/var/local/backups/$FQDN
find $BASE -path '*Attachments*' -size +15000k -exec rm '{}' ';'
-for i in `find /etc -name '*.orig' | sed -e 's,\.orig$,,'`; do
+for i in `find /etc -name '*.orig' -o -name '*.dpkg-new' | sed -e 's,\.\(orig\|dpkg-new\)$,,' | sort -u`; do
if [ -e $i ]; then
+ if [ -e $i.dpkg-new ]; then
+ orig="$i.dpkg-new"
+ elif [ -e $i.orig ]; then
+ orig="$i.orig"
+ elif [ -e $i.old ]; then
+ orig="$i.old"
+ else
+ echo "What the f... Original for \"$i\" has disappeared again?!?"
+ exit 1
+ fi
mkdir -p $BACKUPDIR/`dirname $i`
cp -fa $i $BACKUPDIR/$i
- diff -ruN $i.orig $i > $BACKUPDIR/$i.diff
+ diff -ruN $orig $i > $BACKUPDIR/$i.diff
fi
done