projects
/
carnet-upgrade.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cedab3
)
Recover config files only once.
author
Valentin Vidic
<vvidic@carnet.hr>
Fri, 28 Dec 2007 16:37:29 +0000
(17:37 +0100)
committer
Valentin Vidic
<vvidic@carnet.hr>
Fri, 28 Dec 2007 16:37:29 +0000
(17:37 +0100)
usr/share/carnet-upgrade/functions.sh
patch
|
blob
|
history
diff --git
a/usr/share/carnet-upgrade/functions.sh
b/usr/share/carnet-upgrade/functions.sh
index
16f3d23
..
a67e267
100644
(file)
--- 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
}