slackbuilds_ponce/network/keepalived/doinst.sh
Marek Wodzinski 0782d45ca0 network/keepalived: Updated for version 2.0.20.
- update to newest version
- disabled nftables support as it doesn't compile on 14.2
- removed dependency of optional sysvinit-functions and simplified rc.keepalived
- moved daemon configuration to /etc/default

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2020-04-24 08:16:35 +07:00

23 lines
708 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...
}
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/default/keepalived.new
config etc/keepalived/keepalived.conf.new
config etc/rc.d/rc.keepalived.new