summaryrefslogtreecommitdiff
path: root/localbackupconfig
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-03-29 13:43:17 +0000
committerJonas Smedegaard <dr@jones.dk>2002-03-29 13:43:17 +0000
commita20a738f722b1e44aeb9e379e017f1f9fa1f0125 (patch)
tree15a93535312fea8710083f6d5177df2c6fefd0ef /localbackupconfig
parent26703710628cc79127bc4952448ae37aa79401eb (diff)
Handle .bak as well.
Diffstat (limited to 'localbackupconfig')
-rwxr-xr-xlocalbackupconfig8
1 files changed, 6 insertions, 2 deletions
diff --git a/localbackupconfig b/localbackupconfig
index 5f39fce..d6e6cf9 100755
--- a/localbackupconfig
+++ b/localbackupconfig
@@ -3,7 +3,7 @@
# /usr/local/sbin/localbackupconfig
# Copyright 2001 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localbackupconfig,v 1.3 2002-03-29 13:33:06 jonas Exp $
+# $Id: localbackupconfig,v 1.4 2002-03-29 13:43:17 jonas Exp $
#
# .dpkg-new files appear when refusing to update a conffile on package update
#
@@ -11,6 +11,8 @@
#
# .old files are for customizing when you don't have the original (anymore)
#
+# .bak is... eh... just in case you felt like using that name now and then...
+#
FQDN=`hostname -f`
BACKUPDIR=/var/local/backups/$FQDN
@@ -20,7 +22,7 @@ if [ -e $LOCALCONFIGDIR ]; then
mkdir -p $BACKUPDIR/$LOCALCONFIGDIR
cp -fa $LOCALCONFIGDIR $BACKUPDIR/`dirname $LOCALCONFIGDIR`/
fi
-changedfiles=`find /etc -name '*.old' -o -name '*.orig' -o -name '*.dpkg-new' | sed -e 's,\.\(old\|orig\|dpkg-new\)$,,' | grep -v "^$LOCALCONFIGDIR" | sort -u`
+changedfiles=`find /etc -name '*.bak' -o -name '*.old' -o -name '*.orig' -o -name '*.dpkg-new' | sed -e 's,\.\(bak\|old\|orig\|dpkg-new\)$,,' | grep -v "^$LOCALCONFIGDIR" | sort -u`
for i in $changedfiles; do
if [ -e $i ]; then
if [ -e $i.dpkg-new ]; then
@@ -29,6 +31,8 @@ for i in $changedfiles; do
orig="$i.orig"
elif [ -e $i.old ]; then
orig="$i.old"
+ elif [ -e $i.bak ]; then
+ orig="$i.bak"
else
echo "What the f... Original for \"$i\" has disappeared?!?"
exit 1