diff options
author | Viacheslav <v.gletenko@vyos.io> | 2021-10-31 15:38:19 +0000 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-01 18:28:23 +0100 |
commit | 18d6073d34d7e0c5ab9eabfe35bbd48e95a84b99 (patch) | |
tree | a139dde9264a6f06e9aa8340811df4ef2cafecef | |
parent | ded9f368a53ef1152380d3b3bf09022464b47807 (diff) | |
download | vyatta-op-vpn-18d6073d34d7e0c5ab9eabfe35bbd48e95a84b99.tar.gz vyatta-op-vpn-18d6073d34d7e0c5ab9eabfe35bbd48e95a84b99.zip |
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-x | scripts/vyatta-vpn-op.pl | 5 |
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'; } |