Skip to content

Commit

Permalink
ipfailover - user check script overrides default
Browse files Browse the repository at this point in the history
When the user supplies a check script, that check script replaces the
default check script.

bug bz1410721
https://bugzilla.redhat.com/show_bug.cgi?id=1410721

Signed-off-by: Phil Cameron <pcameron@redhat.com>
  • Loading branch information
pecameron committed Jan 16, 2017
1 parent 8394f91 commit 82b3d97
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions images/ipfailover/keepalived/lib/config-generators.sh
Expand Up @@ -44,6 +44,8 @@ function generate_global_config() {

#
# Generate VRRP checker script configuration section.
# When a check script is provided use it instead of default script
# The default script is suppressed When port is 0
#
# Example:
# generate_script_config
Expand All @@ -56,13 +58,14 @@ function generate_script_config() {
echo ""
echo "vrrp_script ${CHECK_SCRIPT_NAME} {"

if [[ "${port}" == "0" ]]; then
echo " script \"true\""
if [[ -n "${HA_CHECK_SCRIPT}" ]]; then
echo " script \"${HA_CHECK_SCRIPT}\""
else
if [[ -n "${HA_CHECK_SCRIPT}" ]]; then
echo " script \"${HA_CHECK_SCRIPT}\""
if [[ "${port}" == "0" ]]; then
echo " script \"true\""
else
echo " script \"</dev/tcp/${serviceip}/${port}\""
fi
echo " script \"</dev/tcp/${serviceip}/${port}\""
fi

echo " interval ${CHECK_INTERVAL_SECS}"
Expand Down Expand Up @@ -165,8 +168,6 @@ function generate_vip_section() {

#
# Generate vrrpd instance configuration section.
# This generates the vrrp_sync_group and vrrp_instance
# There is one VIP per vrrp_sync_group
#
# Examples:
# generate_vrrpd_instance_config arp 1 "10.1.2.3" enp0s8 "252" "master"
Expand Down

0 comments on commit 82b3d97

Please sign in to comment.