X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Fscripts%2Fvpn-watch;h=08d562be8499bb44c75b31c2e60357625fd1649d;hb=af0e9924804e241452f2efbb2e12ca7dacf8385a;hp=462c6c3164b0cf2df4d89b14281cd1720db51d1b;hpb=f515baebd4325758562c8f178ce31b7331490957;p=people%2Fpmueller%2Fipfire-2.x.git diff --git a/src/scripts/vpn-watch b/src/scripts/vpn-watch index 462c6c3164..08d562be84 100755 --- a/src/scripts/vpn-watch +++ b/src/scripts/vpn-watch @@ -1,6 +1,6 @@ #!/usr/bin/perl ################################################## -##### VPN-Watch.pl Version 0.4 ##### +##### VPN-Watch.pl Version 0.4a ##### ################################################## # # # VPN-Watch is part of the IPFire Firewall # @@ -50,15 +50,15 @@ foreach (@vpnsettings){ my $remoteip = `/usr/bin/ping -c 1 $remotehostname 2>/dev/null | head -n1 | awk '{print \$3}' | tr -d '()' | tr -d ':'`;chomp($remoteip); if ($remoteip eq ""){next;if ($debug){logger("Unable to resolve $remotehostname.");}} my $connected= `ipsec whack --status | grep $remoteip`; - my $established= `ipsec whack --status | grep '$settings[2]' | grep 'ISAKMP SA established'`; + my $established= `ipsec whack --status | grep '$settings[2]' | grep 'IPsec SA established'`; if ( $established eq '' || $connected eq '' ){ logger("Remote IP for host $remotehostname has changed or no connection is established, restarting connection to $remoteip."); system("/usr/local/bin/ipsecctrl S $settings[0]"); - next; + last; #all connections will reloaded } - if ($debug){logger("All connections may be fine nothing was done.");} } + if ($debug){logger("All connections may be fine nothing was done.");} } sub logger {