костыль для контроля за pppoe
pinghost='wood.ru'
timeq=`date +%Y-%m-%d" "%H-%M`
mymail='xxxxxxxxxx@xxxxxxxxxxx.ru'
if ping $pinghost -c1 >/dev/null 2>&1 ; then
echo "PING $timeq">>pingi.txt
else
echo "NOPING $timeq">>pingi.txt
if ! ip a|grep ppp0 >/dev/null ; then
if ! pgrep pppd >/dev/null ; then
pon dsl-provider >/dev/null
fi
fi
fi
if [ `date +%H%M` = "0000" ] ; then
fl=0
while read line ; do
if [ `echo $line|cut -f1 -d" "` = "NOPING" ] ; then
if [ $fl = 0 ] ; then
fl=1
error="NOPING from `echo $line|cut -f2,3 -d' '` to"
fi
else
if [ $fl = 1 ] ; then
echo "$error `echo $line|cut -f2,3 -d' '`">>check.txt
fi
fl=0
fi
done <pingi.txt
echo "Summ of pings must be 1440, we have `cat pingi.txt |wc -l` pings" >> check.txt
cat check.txt|mail -s"PINGI $HOSTMANE" $mymail
>pingi.txt
rm check.txt
fi