From: Valentin Vidic Date: Fri, 28 Dec 2007 16:37:29 +0000 (+0100) Subject: Recover config files only once. X-Git-Tag: debian/4.0.1~87 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=ab75f551cbebec6dbb9f4d0bc3d332affde718e7;p=carnet-upgrade.git Recover config files only once. --- diff --git a/usr/share/carnet-upgrade/functions.sh b/usr/share/carnet-upgrade/functions.sh index 16f3d23..a67e267 100644 --- a/usr/share/carnet-upgrade/functions.sh +++ b/usr/share/carnet-upgrade/functions.sh @@ -388,15 +388,16 @@ fix_etc_default_raid2 () { # restore distribution config file restore_config () { - local file + local file file_backup for file in "$@"; do - if [ -e "$file" ]; then - # backup changes - [ ! -e "$file.cn3-upgrade" ] && mv "$file" "$file.cn3-upgrade" + file_backup=$file.cn3-upgrade + if [ -e $file -a ! -e $file_backup ]; then + # backup file + mv $file $file_backup # install original - cp "/usr/share/carnet-upgrade/files/$file" "$file" + cp /usr/share/carnet-upgrade/files/$file $file fi done }