diff options
author | Kim Hagen <kim.sidney@gmail.com> | 2019-01-15 16:33:15 +0100 |
---|---|---|
committer | Kim Hagen <kim.sidney@gmail.com> | 2019-01-15 16:33:15 +0100 |
commit | a774a829810a1adccabda31028f727fd2ba3b978 (patch) | |
tree | 8c588017d347ddfee2b3fbe22392055b0afe9baa | |
parent | 12996340fe2a1e15613bb047d2f649f6205688ad (diff) | |
download | vyatta-cfg-vpn-a774a829810a1adccabda31028f727fd2ba3b978.tar.gz vyatta-cfg-vpn-a774a829810a1adccabda31028f727fd2ba3b978.zip |
do not display connection header when there are no tunnels created
-rwxr-xr-x | scripts/dmvpn-config.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/dmvpn-config.pl b/scripts/dmvpn-config.pl index 63f1854..475c217 100755 --- a/scripts/dmvpn-config.pl +++ b/scripts/dmvpn-config.pl @@ -36,9 +36,9 @@ my $LOGFILE = '/var/log/vyatta/ipsec.log'; my $vpn_cfg_err = "VPN configuration error:"; my $genout; my $dh_disable; +my my $conf_header = 0; $genout .= "# generated by $0\n\n"; -$genout .= "connections {\n"; # # Prepare Vyatta::Config object @@ -167,6 +167,11 @@ if ( $vcVPN->exists('ipsec') ) { my $needs_passthrough = 'false'; my $tunKeyword = 'tunnel ' . "$tunnel"; + if ( $conf_header eq 0 ) { + $genout .= "connections {\n"; + $conf_header = 1; + } + my $conn_head = "\tdmvpn-$profile-$tunnel {\n"; $genout .= $conn_head; |