summaryrefslogtreecommitdiff
path: root/network/keepalived/doinst.sh
diff options
context:
space:
mode:
authorNilton Moura <nmoura@nmoura.eti.br>2010-09-09 10:48:20 -0400
committerdsomero <xgizzmo@slackbuilds.org>2010-09-09 10:48:20 -0400
commit7d5ffabc4dd36157ffce5ed8f57a38bfb4307350 (patch)
tree8f74b1d4197a2cd60ceb0ecfe3d1dea4be7e7ad1 /network/keepalived/doinst.sh
parentda87ad250c8ef9600cd69b419a1f241770303423 (diff)
downloadslackbuilds-7d5ffabc4dd36157ffce5ed8f57a38bfb4307350.tar.gz
network/keepalived: Added (HealthChecking for LVS & HA cluters)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network/keepalived/doinst.sh')
-rw-r--r--network/keepalived/doinst.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/network/keepalived/doinst.sh b/network/keepalived/doinst.sh
new file mode 100644
index 0000000000..7062d561a6
--- /dev/null
+++ b/network/keepalived/doinst.sh
@@ -0,0 +1,23 @@
+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...
+}
+
+if [ -e etc/rc.d/rc.keepalived ]; then
+ cp -a etc/rc.d/rc.keepalived etc/rc.d/rc.keepalived.new.incoming
+ cat etc/rc.d/rc.keepalived.new > etc/rc.d/rc.keepalived.new.incoming
+ mv etc/rc.d/rc.keepalived.new.incoming etc/rc.d/rc.keepalived.new
+fi
+
+config etc/keepalived/keepalived.new
+config etc/keepalived/keepalived.conf.new
+config etc/rc.d/rc.keepalived.new
+