finish script

This commit is contained in:
ofreax 2016-08-27 10:37:00 +02:00
parent e8fb1f02e2
commit 4ae2a8641f
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/bin/bash -e
# set -x (bash debug) if log level is trace
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/log-helper
log-helper level eq trace && set -x
# try to delete virtual ips from interface
for vip in $(complex-bash-env iterate KEEPALIVED_VIRTUAL_IPS)
do
ip addr del ${vip}/32 dev ${KEEPALIVED_INTERFACE} || true
done
exit 0

View File

@ -39,6 +39,12 @@ if [ ! -e "$FIRST_START_DONE" ]; then
touch $FIRST_START_DONE touch $FIRST_START_DONE
fi fi
# try to delete virtual ips from interface
for vip in $(complex-bash-env iterate KEEPALIVED_VIRTUAL_IPS)
do
ip addr del ${vip}/32 dev ${KEEPALIVED_INTERFACE} || true
done
if [ ! -e "/etc/backup-manager.conf" ]; then if [ ! -e "/etc/backup-manager.conf" ]; then
ln -sf ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf /etc/keepalived/keepalived.conf ln -sf ${CONTAINER_SERVICE_DIR}/keepalived/assets/keepalived.conf /etc/keepalived/keepalived.conf
fi fi