summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-02-17 18:28:26 -0600
committerJohn Southworth <john.southworth@vyatta.com>2011-02-17 18:28:26 -0600
commit9445d85b11639fed96be46264efb6903b15fa8b4 (patch)
treeb14900aa97ca5c694117dea2e19476685a1a3b34
parentb3a8222b4513bffa268993fd24796ab9a8b64afb (diff)
downloadvyatta-cfg-vpn-9445d85b11639fed96be46264efb6903b15fa8b4.tar.gz
vyatta-cfg-vpn-9445d85b11639fed96be46264efb6903b15fa8b4.zip
Fix the no old ip given from dhclient problem
-rwxr-xr-xscripts/vyatta-ipsec-dhcp.pl9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/vyatta-ipsec-dhcp.pl b/scripts/vyatta-ipsec-dhcp.pl
index e034810..61e5e02 100755
--- a/scripts/vyatta-ipsec-dhcp.pl
+++ b/scripts/vyatta-ipsec-dhcp.pl
@@ -91,11 +91,10 @@ close FD;
open my $output_secrets, '>', $secrets_file
or die "Can't open $secrets_file";
foreach my $line (@lines){
- if (($line =~ /\#dhcp-interface=(.*)\#/) && ($1 eq $iface)){
- $line =~ s/^$oip/$nip/;
- if (!($line =~ /^oip/)){
- $line =~ s/^/$nip/;
- }
+ if (($line =~ /(.*)\#dhcp-interface=(.*)\#/) && ($2 eq $iface)){
+ my $secretline = $1;
+ $secretline =~ /(.*?) (.*?) : PSK (.*)/;
+ $line = "$nip $2 : PSK $3\#dhcp-interface=$iface\#\n";
}
print ${output_secrets} $line;
}