From 974895246d4163c04d701648f544cb63f64c2d8e Mon Sep 17 00:00:00 2001 From: John Southworth Date: Thu, 20 Jan 2011 18:01:50 -0600 Subject: make adjustment so that op mode can deal with new secrets file format (cherry picked from commit ef7acbaef8ccd9305644f22ddb6df1ca985fcf4a) --- scripts/vpn-config.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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' ) { -- cgit v1.2.3