Add functionality for keepalived notify script

Signed-off-by: Rémi PAETA <remi.paeta@comaite.com>
pull/275/head
Rémi PAETA 2 years ago
parent 3de2c1f8d3
commit d8b9d67273

@ -64,6 +64,12 @@ get_check_script() {
echo $script
}
get_notify_script() {
notify_script="$VROUTER_KEEPALIVED_NOTIFY_SCRIPT"
echo $notify_script
}
get_iface_var() {
var_name="$1_$2"
var=$(eval "echo \"\${$var_name}\"")
@ -133,6 +139,16 @@ EOT
fi
}
gen_notify_script() {
notify_script="$(get_notify_script)"
if [ -n "$notify_script" ]; then
cat <<EOT
notify "$notify_script"
EOT
fi
}
gen_preempt() {
script="$(get_check_script)"
@ -160,6 +176,7 @@ vrrp_instance $interface {
$(gen_auth)
$(gen_track)
$(gen_preempt)
$(gen_notify_script)
}
EOT

Loading…
Cancel
Save