From a20a738f722b1e44aeb9e379e017f1f9fa1f0125 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 29 Mar 2002 13:43:17 +0000 Subject: Handle .bak as well. --- localbackupconfig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'localbackupconfig') 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 # -# $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 -- cgit v1.2.3