diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-01-20 18:01:50 -0600 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-01-20 19:39:41 -0600 |
commit | 974895246d4163c04d701648f544cb63f64c2d8e (patch) | |
tree | 6eb2f1e0b5bd940512b6883eb40121ba11d87990 | |
parent | 99083911dd340dcbcfa6215420ff4913696a9043 (diff) | |
download | vyatta-cfg-vpn-974895246d4163c04d701648f544cb63f64c2d8e.tar.gz vyatta-cfg-vpn-974895246d4163c04d701648f544cb63f64c2d8e.zip |
make adjustment so that op mode can deal with new secrets file format
(cherry picked from commit ef7acbaef8ccd9305644f22ddb6df1ca985fcf4a)
-rwxr-xr-x | scripts/vpn-config.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl index c6ab840..780b09b 100755 --- a/scripts/vpn-config.pl +++ b/scripts/vpn-config.pl @@ -901,7 +901,15 @@ if ( $vcVPN->exists('ipsec') ) { if ( defined ($authremoteid) ) { $genout_secrets .= "$authremoteid "; } - $genout_secrets .= ": PSK \"$psk\"\n"; + # tag the secrets lines with 3 entries so the op mode command can + # deal with them properly. (LEFT means localid, RIGHT means remoteid) + if ((!defined($authid)) && (defined($authremoteid))) { + $genout_secrets .= ": PSK \"$psk\" #RIGHT#\n"; + } elsif ((defined($authid)) && (!defined($authremoteid))) { + $genout_secrets .= ": PSK \"$psk\" #LEFT#\n"; + } else { + $genout_secrets .= ": PSK \"$psk\"\n"; + } } $genout .= "\tauthby=secret\n"; } elsif ( defined($auth_mode) && $auth_mode eq 'rsa' ) { |