From 5a9d224e41583110b74c3ab46ebc68028acafed9 Mon Sep 17 00:00:00 2001 From: Manlio Modugno Date: Sat, 28 Aug 2010 08:11:09 -0400 Subject: system/apache-cassandra: Added (distributed database) Signed-off-by: dsomero --- system/apache-cassandra/doinst.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 system/apache-cassandra/doinst.sh (limited to 'system/apache-cassandra/doinst.sh') diff --git a/system/apache-cassandra/doinst.sh b/system/apache-cassandra/doinst.sh new file mode 100644 index 0000000000..95008b7254 --- /dev/null +++ b/system/apache-cassandra/doinst.sh @@ -0,0 +1,21 @@ +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... +} + +# Keep same perms on rc.tomcat.new: +if [ -e etc/rc.d/rc.cassandra ]; then + cp -a etc/rc.d/rc.cassandra etc/rc.d/rc.cassandra.new.incoming + cat etc/rc.d/rc.cassandra.new > etc/rc.d/rc.cassandra.new.incoming + mv etc/rc.d/rc.cassandra.new.incoming etc/rc.d/rc.cassandra.new +fi + +config etc/rc.d/rc.cassandra.new -- cgit v1.2.3