diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-02-17 18:28:26 -0600 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-02-17 18:28:26 -0600 |
commit | 9445d85b11639fed96be46264efb6903b15fa8b4 (patch) | |
tree | b14900aa97ca5c694117dea2e19476685a1a3b34 | |
parent | b3a8222b4513bffa268993fd24796ab9a8b64afb (diff) | |
download | vyatta-cfg-vpn-9445d85b11639fed96be46264efb6903b15fa8b4.tar.gz vyatta-cfg-vpn-9445d85b11639fed96be46264efb6903b15fa8b4.zip |
Fix the no old ip given from dhclient problem
-rwxr-xr-x | scripts/vyatta-ipsec-dhcp.pl | 9 |
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; } |