From 8b224e177ef4b2889d3e44940196230a24bde392 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Mon, 12 Dec 2011 16:32:14 -0800 Subject: Add filtering to transition scripts for vmac interfaces; Make transition script able to detect if the interface is a vmac interface before applying the vmac specific changes --- scripts/keepalived/vyatta-keepalived.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/keepalived/vyatta-keepalived.pl') diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl index f7b6bfe7..5c7676ea 100755 --- a/scripts/keepalived/vyatta-keepalived.pl +++ b/scripts/keepalived/vyatta-keepalived.pl @@ -146,8 +146,10 @@ sub keepalived_get_values { } my $use_vmac = 0; + my $transition_intf = $intf; if ( $config->exists("interface") ) { $use_vmac = 1; + $transition_intf = "$intf"."v"."$group"; } my $priority = $config->returnValue("priority"); @@ -300,11 +302,11 @@ sub keepalived_get_values { } $output .= "\t\}\n"; $output .= "\tnotify_master \"$state_transition_script master "; - $output .= "$intf $group $run_master_script @vips\" \n"; + $output .= "$intf $group $transition_intf $run_master_script @vips\" \n"; $output .= "\tnotify_backup \"$state_transition_script backup "; - $output .= "$intf $group $run_backup_script @vips\" \n"; + $output .= "$intf $group $transition_intf $run_backup_script @vips\" \n"; $output .= "\tnotify_fault \"$state_transition_script fault "; - $output .= "$intf $group $run_fault_script @vips\" \n"; + $output .= "$intf $group $transition_intf $run_fault_script @vips\" \n"; $output .= "\}\n\n"; } -- cgit v1.2.3