>зависит от реализации ppp...
причем тут это???
хотя может и причем-то :-)
вот вам скрипт юзайте на здоровье :)))
#Your MUST set this variables
PEER_FILE=""
DOSYSLOGMSG="1"
PAUSE="15"
##
#Optional variables
PPPD_OPTIONS=""
TESTHOST1=""
TESTHOST2=""
TESTHOST3=""
##
##
#Functions
do_connect()
{
pppd call $PEER_FILE $PPPD_OPTIONS
sleep $PAUSE
#Postconnect actions
route add default gw 10.1.1.1
##
if do_test_connect
then
return 0
else
return 1
fi
}
do_kill_connect()
{
killall pppd 2> /dev/null
sleep $PAUSE
}
host_alive()
{
if ping -c 1 -I ppp0 $1 > /dev/null
then
return 0
else
return 1
fi
}
do_test_connect()
{
if host_alive ${TESTHOST1:-google.com}
then
return 0
else
if host_alive ${TESTHOST2:-kernel.org}
then
echo "${TESTHOST1:-google.com} is down"
return 0
else
if host_alive ${TESTHOST3:-ya.ru}
then
echo "${TESTHOST1:-google.com} and ${TESTHOST2:-kernel.org} are down"
return 0
else
return 1
fi
fi
fi
}
do_logger_test()
{
if [ -f /usr/bin/logger ]
then
return 0
else
echo "I can't find /usr/bin/logger . This is part of sys-apps/util-linux... If you want have report in syslog, please install it."
return 1
fi
}
##
#Body
if do_test_connect
then
# echo "connected"
exit 0
else
# echo "connect not detected"
do_kill_connect
if do_connect
then
exit 0
else
echo "`date` : Connection lost. I\'m CAN\'T connecting."
[ "$DOSYSLOGMSG" = "1" ] && do_logger_test && logger "`basename $0` Connection lost, can't reconnect."
exit 1
fi
fi
##
#EOF
должно работать!!!
нравится?