Fix vpn-watch script not restarting minutly when remote ip has changed.

This commit is contained in:
Christian Schmidt
2011-01-22 11:16:39 +01:00
parent 9f9298d994
commit aa7970cc87

View File

@@ -57,7 +57,7 @@ foreach (@vpnsettings){
my $ipmatch= `echo "$status" | grep '$remoteip' | grep '$settings[2]'`;
my $established= `echo "$status" | grep '$settings[2]' | grep 'erouted;'`;
if ( $ipmatch eq '' && $status ne ''){
if ( $round == 0 && $ipmatch eq '' && $status ne ''){
logger("Remote IP for host $remotehostname($remoteip) has changed, restarting ipsec.");
system("/usr/local/bin/ipsecctrl S $settings[0]");
$round=0;