summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav <v.gletenko@vyos.io>2021-10-31 15:38:19 +0000
committerChristian Poessinger <christian@poessinger.com>2021-11-01 18:28:23 +0100
commit18d6073d34d7e0c5ab9eabfe35bbd48e95a84b99 (patch)
treea139dde9264a6f06e9aa8340811df4ef2cafecef
parentded9f368a53ef1152380d3b3bf09022464b47807 (diff)
downloadvyatta-op-vpn-crux.tar.gz
vyatta-op-vpn-crux.zip
vpn-op: T3846: Fix for restart vpn with nhrp config1.2.9-S1crux
After command "restart vpn" nhrp/IPSec configuration not loaded Add checks if nhrp exist in the configuration and help to load it via swanctl. (cherry picked from commit 49ebd98d580c8cea83da510ded19d7bc163218c4)
-rwxr-xr-xscripts/vyatta-vpn-op.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/vyatta-vpn-op.pl b/scripts/vyatta-vpn-op.pl
index 8bf0301..3be7fd8 100755
--- a/scripts/vyatta-vpn-op.pl
+++ b/scripts/vyatta-vpn-op.pl
@@ -62,6 +62,11 @@ if ($op eq 'clear-vpn-ipsec-process') {
my $update_interval = `cli-shell-api returnActiveValue vpn ipsec auto-update`;
if ($update_interval eq ''){
system 'sudo /usr/sbin/ipsec restart >&/dev/null';
+ # Check if nhrp configuration exists, exit code
+ # As 'restart vpn' doesn't load nhrp configuration T3846
+ if (system('cli-shell-api existsActive protocols nhrp') == 0) {
+ system 'sudo swanctl --load-all';
+ }
} else {
system 'sudo /usr/sbin/ipsec restart --auto-update '.$update_interval.' >&/dev/null';
}