From f5988461f2e04a7ba5bd385fa5902a4f69647bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20PAETA?= Date: Tue, 18 Oct 2022 15:01:47 +0200 Subject: [PATCH] Add functionality for keepalived notify script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi PAETA --- src/etc/one-context.d/loc-15-keepalived##vr | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/etc/one-context.d/loc-15-keepalived##vr b/src/etc/one-context.d/loc-15-keepalived##vr index 074649b..b9a4b6c 100755 --- a/src/etc/one-context.d/loc-15-keepalived##vr +++ b/src/etc/one-context.d/loc-15-keepalived##vr @@ -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 <