blob: fa0ce22fefc180126190119c804feead022a3928 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
config() {
NEW="$1"
OLD="${1%.new}"
if [ ! -r $OLD ];
then
# If there's no config file by that name, mv it over:
mv $NEW $OLD
elif [ "$(md5sum <$OLD)" = "$(md5sum <$NEW)" ];
then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
|