summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/vpn-config.pl27
1 files changed, 3 insertions, 24 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index 69ca64c..423df4b 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -75,12 +75,11 @@ $vcVPN->setLevel('vpn');
# check to see if the config has changed.
# if it has not then exit
-my $retval = getConfigStatus('ipsec', $vcVPN);
-my $retval2 = getConfigStatus('rsa-keys', $vcVPN);
-if (!$retval && !$retval2) {
+my $ipsecstatus = $vcVPN->isChanged('ipsec');
+my $rsastatus = $vcVPN->isChanged('rsa-keys');
+if (!$ipsecstatus && !$rsastatus) {
exit 0;
}
-
if ( $vcVPN->exists('ipsec') ) {
#
@@ -1426,25 +1425,5 @@ EOS
close $dhcp_hook;
}
-sub getConfigStatus {
- my ($level, $vconfig) = @_;
- my @nodes = $vconfig->listNodes($level);
- foreach my $node (@nodes){
- my $newlevel = "$level $node";
- return 1 if ($vconfig->isChanged($newlevel));
- getConfigStatus($newlevel, $vconfig);
- }
-}
-
-sub logger {
- my $msg = pop(@_);
- my $FACILITY = "daemon";
- my $LEVEL = "notice";
- my $TAG = "vyatta-vpn-config";
- my $LOGCMD = "logger -t $TAG -p $FACILITY.$LEVEL";
- system("$LOGCMD $msg");
-}
-
-
# end of file