summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-02-23 18:35:53 -0600
committerJohn Southworth <john.southworth@vyatta.com>2011-02-23 18:35:53 -0600
commit2250f25d598023daf7d5e43dc4266cf04f51b44b (patch)
treefab1a795da4b51f4c0de0df22b25fc5897038a03
parentee9a48f03fca3d31e8b66d565ce8ff5d1c2e3b7c (diff)
downloadvyatta-cfg-vpn-2250f25d598023daf7d5e43dc4266cf04f51b44b.tar.gz
vyatta-cfg-vpn-2250f25d598023daf7d5e43dc4266cf04f51b44b.zip
Much cleaner way to do the check to see if something has changed in the ipsec or rsa-key config tree.
-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