Mr. BBQ
Der Wurstfachverkäuferin
ich hab hier ein selbstgeschriebenes reconnect-script
mein problem ist nun, dass meine leitung manchmal trotzdem ausfällt. was ich herausgefunden habe, bleibt manchmal das script bei "/sbin/ping -c 1 www.tilt-lan.com >/dev/null" oder "/sbin/ping -c 1 213.229.45.253 >/dev/null" hängen und zwar wenn ich manuel pinge gibt er mir aus "ping: unknown host" bzw. "no route to host" wie kann ich diesen fehler wieder umgehen?
Code:
while true ; do
# Test if connection is really ok
/sbin/ping -c 1 www.tilt-lan.com >/dev/null
if [ $? != 0 ]
then
echo "#############################################"
echo "#connection is not ok - trying once again...#"
echo "#############################################"
# Here I am using the IP-address from my ISP's gateway
/sbin/ping -c 1 213.229.45.253 >/dev/null
if [ $? != 0 ]
then
echo "######################################"
echo "#connection is dead - reconnecting...#"
echo "######################################"
echo " "
echo "######################"
echo "#killing pf daemon...#"
echo "######################"
/sbin/pfctl -d
# define log file
LOG=/var/log/adsl
echo "#########################################"
echo "#starting connection, or reconnecting...#"
echo "#########################################"
/usr/bin/pkill -9 /usr/local/sbin/pptp
/usr/local/sbin/pptp 10.0.0.138 &
sleep 30
echo " "
echo "####################################"
echo "#starting or restarting firewall...#"
echo "####################################"
/sbin/pfctl -e -F all -f /etc/pf.conf
/bin/date >> $LOG
echo "### connection lost and restartet ###" >> $LOG
fi
fi
sleep 60 # wait one minute and then check again
done
mein problem ist nun, dass meine leitung manchmal trotzdem ausfällt. was ich herausgefunden habe, bleibt manchmal das script bei "/sbin/ping -c 1 www.tilt-lan.com >/dev/null" oder "/sbin/ping -c 1 213.229.45.253 >/dev/null" hängen und zwar wenn ich manuel pinge gibt er mir aus "ping: unknown host" bzw. "no route to host" wie kann ich diesen fehler wieder umgehen?