summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-xlib/Vyatta/Keepalived.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm
index fafaafe1..00a14f95 100755
--- a/lib/Vyatta/Keepalived.pm
+++ b/lib/Vyatta/Keepalived.pm
@@ -23,7 +23,7 @@
#
package Vyatta::Keepalived;
our @EXPORT = qw(get_conf_file get_state_script get_state_file
- vrrp_log vrrp_get_init_state
+ vrrp_log vrrp_get_init_state get_changes_file
start_daemon restart_daemon stop_daemon);
use base qw(Exporter);
@@ -40,7 +40,7 @@ my $state_transition = "$sbin_dir/vyatta-vrrp-state.pl";
my $keepalived_pid = '/var/run/keepalived_vrrp.pid';
my $state_dir = '/var/run/vrrpd';
my $vrrp_log = "$state_dir/vrrp.log";
-
+my $changes_file = "$state_dir/changes";
sub vrrp_log {
my $timestamp = strftime("%Y%m%d-%H:%M.%S", localtime);
@@ -104,6 +104,11 @@ sub get_state_script {
return $state_transition;
}
+sub get_changes_file {
+ system("mkdir $state_dir") if ! -d $state_dir;
+ return $changes_file;
+}
+
sub get_state_file {
my ($vrrp_intf, $vrrp_group) = @_;