diff options
author | Mohit Mehta <mohit@vyatta.com> | 2008-03-20 16:30:08 -0700 |
---|---|---|
committer | Mohit Mehta <mohit@vyatta.com> | 2008-03-20 16:30:08 -0700 |
commit | 814b58b62fcb20c45f0a8e31f6f09e308aabc39f (patch) | |
tree | 4fff8ec80e2c106f5268400f528d2e7a9ac695f5 /scripts/keepalived/vyatta-vrrp-state.pl | |
parent | f8620172d349b7892fdb56ee9a98a549e849b9ed (diff) | |
download | vyatta-cfg-quagga-814b58b62fcb20c45f0a8e31f6f09e308aabc39f.tar.gz vyatta-cfg-quagga-814b58b62fcb20c45f0a8e31f6f09e308aabc39f.zip |
Fix Bug 2778 VRRP: add ability to run scripts on state transition
- enhancement added: configuring of scripts to run on vrrp state-transitions
Diffstat (limited to 'scripts/keepalived/vyatta-vrrp-state.pl')
-rwxr-xr-x | scripts/keepalived/vyatta-vrrp-state.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/keepalived/vyatta-vrrp-state.pl b/scripts/keepalived/vyatta-vrrp-state.pl index 8b813529..9e11b649 100755 --- a/scripts/keepalived/vyatta-vrrp-state.pl +++ b/scripts/keepalived/vyatta-vrrp-state.pl @@ -55,7 +55,8 @@ sub vrrp_state_log { my $vrrp_state = $ARGV[0]; my $vrrp_intf = $ARGV[1]; my $vrrp_group = $ARGV[2]; -my $vrrp_vip = $ARGV[3]; +my $vrrp_transitionscript = $ARGV[3]; +my $vrrp_vip = $ARGV[4]; my $sfile = VyattaKeepalived::get_state_file($vrrp_intf, $vrrp_group); my ($old_time, $old_intf, $old_group, $old_state, $old_ltime) = @@ -77,6 +78,12 @@ if ($vrrp_state eq "backup") { system("rm -f $mfile"); } + +if (!($vrrp_transitionscript eq "null")){ + exec("$vrrp_transitionscript"); +} + + exit 0; # end of file |