2010-05-13 01:01:06 +02:00
|
|
|
config() {
|
|
|
|
NEW="$1"
|
|
|
|
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
|
|
# If there's no config file by that name, mv it over:
|
|
|
|
if [ ! -r $OLD ]; then
|
|
|
|
mv $NEW $OLD
|
2012-03-30 06:15:24 +02:00
|
|
|
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
|
|
|
# toss the redundant copy
|
2010-05-13 01:01:06 +02:00
|
|
|
rm $NEW
|
|
|
|
fi
|
|
|
|
# Otherwise, we leave the .new copy for the admin to consider...
|
|
|
|
}
|
|
|
|
|
2012-12-02 18:35:22 +01:00
|
|
|
preserve_perms() {
|
|
|
|
NEW="$1"
|
|
|
|
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
|
|
if [ -e $OLD ]; then
|
|
|
|
cp -a $OLD ${NEW}.incoming
|
|
|
|
cat $NEW > ${NEW}.incoming
|
|
|
|
mv ${NEW}.incoming $NEW
|
|
|
|
fi
|
|
|
|
config $NEW
|
|
|
|
}
|
|
|
|
|
2014-03-31 04:08:52 +02:00
|
|
|
config etc/redis/redis.conf.new
|
2015-06-07 12:50:48 +02:00
|
|
|
config etc/redis/sentinel.conf.new
|
2012-12-02 18:35:22 +01:00
|
|
|
config etc/logrotate.d/redis.new
|
|
|
|
preserve_perms etc/rc.d/rc.redis.new
|