From 0fe5c268a97662fa2298e4901fda2d20bb4aa467 Mon Sep 17 00:00:00 2001 From: ms Date: Sun, 15 Jul 2007 09:40:12 +0000 Subject: [PATCH] VPN-Watch ueberprueft nun ob der Tunnel da ist und nicht der ISAKMP. VPN-Restart gekillt. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@692 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/rootfiles/common/stage2 | 1 - src/scripts/vpn-restart | 66 ---------------------------------- src/scripts/vpn-watch | 2 +- 3 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 src/scripts/vpn-restart diff --git a/config/rootfiles/common/stage2 b/config/rootfiles/common/stage2 index 9ad990fee8..26d1905988 100644 --- a/config/rootfiles/common/stage2 +++ b/config/rootfiles/common/stage2 @@ -69,7 +69,6 @@ usr/local/bin/setreservedports usr/local/bin/settime usr/local/bin/timecheck usr/local/bin/tunerrd.pl -usr/local/bin/vpn-restart usr/local/bin/vpn-watch #usr/local/include #usr/local/lib diff --git a/src/scripts/vpn-restart b/src/scripts/vpn-restart deleted file mode 100644 index 68472635dd..0000000000 --- a/src/scripts/vpn-restart +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# VPN Restart/Checker by Figo - -##################################################### -part=xxxx #partner frei Wählbar -net=xxxx.homeip.net #Partner DYNDNS Adresse -vpn=xxxx #VPN Name wie unter GUI -iplocal=192.168.x.x #Lokale IP -ipremote=192.168.x.x #Partner IP -LOGFILE=/var/log/vpn_$vpn.log -maxlog=2000 #Max groesse des Logfiles in Byte -##################################################### -ping -c 3 $net -if [ $? != 0 ] ; then -clear -echo "##############################################" -echo "# $part ist offline #" -echo "# Verbindung zu $part nicht moeglich #" -echo "$(date) $part ist offline #" >> $LOGFILE -echo "$(date) Verbindung zu $part nicht moeglich #" >> $LOGFILE -echo "##############################################" -else -clear -echo "##############################################" -echo "# Na ein Glueck $part is online #" -echo "##############################################" -/usr/bin/ping -i 2 -c 2 -n -I $iplocal $ipremote -if test $? -ne 0; then -clear -echo "##############################################" -echo "# `grep -c ms $LOGFILE` #" -echo "# $(date) #" -echo "##############################################" -echo "$(date) Tunnel zu $part ist NICHT da #" >> $LOGFILE -echo "$(date) Starte Tunnel $vpn neu #" >> $LOGFILE -echo "# Tunnel zu $part ist NICHT da #" -echo "# Starte Tunnel $vpn neu #" -echo "##############################################" -ipsec auto --replace $vpn -ipsec auto --rereadsecrets -ipsec auto --up $vpn -else -clear -echo "###############################################" -echo "$(date) Tunnel zu $part steht #" >> $LOGFILE -echo "# $(date) #" -echo "# Tunnel zu $part steht #" -echo " seine WAN IP ist `host $net | cut -d" " -f4` " -echo "# seine Lokale IP ist $ipremote #" -echo "###############################################" - - -if test `stat -c %s $LOGFILE` -lt $maxlog; then -echo "# $LOGFILE < $maxlog Bytes #" -else -echo "##############################################" -echo "# $LOGFILE > $maxlog Bytes #" -echo "# Maximale groesse des Logfile #" -echo "# Logfile wird geloescht #" -echo "##############################################" -rm $LOGFILE -fi - -fi -fi -exit 0 diff --git a/src/scripts/vpn-watch b/src/scripts/vpn-watch index 462c6c3164..74a4dc5c1a 100755 --- a/src/scripts/vpn-watch +++ b/src/scripts/vpn-watch @@ -50,7 +50,7 @@ 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."); -- 2.39.2