2010-05-12 23:31:57 +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
|
|
|
|
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
|
|
|
# toss the redundant copy
|
|
|
|
rm $NEW
|
|
|
|
fi
|
|
|
|
# Otherwise, we leave the .new copy for the admin to consider...
|
|
|
|
}
|
|
|
|
|
2010-05-13 00:35:43 +02:00
|
|
|
# Keep same perms:
|
2010-05-12 23:31:57 +02:00
|
|
|
if [ -e etc/httpd/extra/httpd-awstats.conf.new ]; then
|
2013-11-08 06:56:46 +01:00
|
|
|
cp -a etc/httpd/extra/httpd-awstats.conf etc/httpd/extra/httpd-awstats.conf.new.incoming
|
2010-05-12 23:31:57 +02:00
|
|
|
cat etc/httpd/extra/httpd-awstats.conf.new > etc/httpd/extra/httpd-awstats.conf.new.incoming
|
|
|
|
mv etc/httpd/extra/httpd-awstats.conf.new.incoming etc/httpd/extra/httpd-awstats.conf.new
|
|
|
|
fi
|
|
|
|
|
|
|
|
config etc/httpd/extra/httpd-awstats.conf.new
|
2011-03-03 18:01:00 +01:00
|
|
|
config etc/awstats/awstats.model.conf.new
|
2010-05-12 23:31:57 +02:00
|
|
|
|