summaryrefslogtreecommitdiff
path: root/system/rabbitmq-server/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'system/rabbitmq-server/doinst.sh')
-rw-r--r--system/rabbitmq-server/doinst.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/system/rabbitmq-server/doinst.sh b/system/rabbitmq-server/doinst.sh
new file mode 100644
index 0000000000..7c748bc08a
--- /dev/null
+++ b/system/rabbitmq-server/doinst.sh
@@ -0,0 +1,23 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+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.rabbitmq.new
+config etc/rabbitmq/rabbitmq-env.conf.new