From 70134d23096dc55c66ea9bb088aa19200be18e99 Mon Sep 17 00:00:00 2001 From: Nicolas Steinmetz Date: Thu, 13 May 2010 00:57:51 +0200 Subject: development/couchdb: Added to 13.0 repository --- development/couchdb/doinst.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 development/couchdb/doinst.sh (limited to 'development/couchdb/doinst.sh') diff --git a/development/couchdb/doinst.sh b/development/couchdb/doinst.sh new file mode 100644 index 0000000000000..5e284380104aa --- /dev/null +++ b/development/couchdb/doinst.sh @@ -0,0 +1,29 @@ +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... +} + +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 +} + +preserve_perms etc/rc.d/rc.couchdb.new +config etc/couchdb/default.ini.new +config etc/couchdb/local.ini.new +config etc/logrotate.d/couchdb.new + -- cgit v1.2.3