slackbuilds_ponce/system/apache-cassandra/doinst.sh
Manlio Modugno 5a9d224e41 system/apache-cassandra: Added (distributed database)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
2010-08-29 15:32:14 -05:00

21 lines
659 B
Bash

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