diff options
author | Stig Thormodsrud <stig@ubnt.com> | 2013-12-18 11:36:50 -0800 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-01-29 04:19:49 +0100 |
commit | b321dc01f533b0ed7359327a2b3bd53b583155b8 (patch) | |
tree | 728f2169bf1eac2d663b0a5a45540fb06fd4f73d /scripts | |
parent | 86140b53bfc5bbb1e0f7ef9b244951303d55ec1e (diff) | |
download | vyatta-cfg-vpn-b321dc01f533b0ed7359327a2b3bd53b583155b8.tar.gz vyatta-cfg-vpn-b321dc01f533b0ed7359327a2b3bd53b583155b8.zip |
Move %any peers to the end in ipsec.secrets
Signed-off-by: Daniil Baturin <daniil@baturin.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vpn-config.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl index 9079148..4870d48 100755 --- a/scripts/vpn-config.pl +++ b/scripts/vpn-config.pl @@ -1329,6 +1329,15 @@ sub write_config { print ${output_config} $genout; close $output_config; + my @lines = split("\n", $genout_secrets); + my @any = grep(/%any/, @lines); + if (scalar(@any) > 0) { + my @noany = grep(!/%any/, @lines); + @lines = (@noany, @any); + $genout_secrets = join("\n", @lines); + $genout_secrets .= "\n"; + } + open my $output_secrets, '>', $secrets_file or die "Can't open $secrets_file: $!"; print ${output_secrets} $genout_secrets; |