diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-05-26 13:49:42 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-05-26 13:49:42 -0700 |
commit | b2b9964782c08fc586f1096e0641765a099f23b6 (patch) | |
tree | 680a8980e19e342ece7f9db28600278700bf09e4 /scripts/keepalived | |
parent | 0cf777376bdf5b347afffff8b5ffe56b269f6614 (diff) | |
download | vyatta-cfg-quagga-b2b9964782c08fc586f1096e0641765a099f23b6.tar.gz vyatta-cfg-quagga-b2b9964782c08fc586f1096e0641765a099f23b6.zip |
Fix 2705: Add "clear vrrp process" command.
Diffstat (limited to 'scripts/keepalived')
-rwxr-xr-x | scripts/keepalived/vyatta-keepalived.pl | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl index 7389534b..ac92ca8e 100755 --- a/scripts/keepalived/vyatta-keepalived.pl +++ b/scripts/keepalived/vyatta-keepalived.pl @@ -157,7 +157,7 @@ sub keepalived_get_values { $output .= "\"$state_transition_script backup $intf $group $run_backup_script @vips\" \n"; $output .= "\tnotify_fault "; $output .= "\"$state_transition_script fault $intf $group $run_fault_script @vips\" \n"; - $output .= "\}\n"; + $output .= "\}\n\n"; } return $output; @@ -301,7 +301,9 @@ sub remove_from_changes { sub vrrp_update_config { my ($intf) = @_; - my $output = ''; + my $date = localtime(); + my $output = "#\n# autogenerated by $0 on $date\n#\n\n"; + my $config = new VyattaConfig; $config->setLevel("interfaces ethernet"); @@ -391,6 +393,7 @@ if ($action eq "update") { } if ($vrrp_instances == 0) { VyattaKeepalived::stop_daemon(); + system("rm -f $conf_file"); } } @@ -405,6 +408,17 @@ if ($action eq "delete") { exit 0; } +if ($action eq "clear") { + if (VyattaKeepalived::is_running()) { + print "Restarting VRRP...\n"; + VyattaKeepalived::restart_daemon(VyattaKeepalived::get_conf_file()); + } else { + print "Starting VRRP...\n"; + VyattaKeepalived::start_daemon(VyattaKeepalived::get_conf_file()); + } + exit 0; +} + exit 0; # end of file |