#!/bin/bash
is_up() {
/sbin/ifconfig|grep "^$1" >/dev/null
}
LOG="/var/log/inet"
IPOE_GREY="vlan2569"
IPOE_WHITE="vlan2568"
PPPOE_GREY="ppp0"
PPPOE_WHITE="ppp1"
#IPoE GREY
echo "Checking IPoE grey"
if is_up $IPOE_GREY; then
if ! `/usr/local/bin/ipoe_grey.sh`; then
echo "`date` ERROR! No inet on IPoE Grey!"
echo "`date` ERROR! No inet on IPoE Grey!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'ipoe grey no inet'
fi
else
echo "`date` Error! IPoE Grey ($IPOE_GREY) is DOWN!"
echo "`date` Error! IPoE Grey ($IPOE_GREY) is DOWN!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'ipoe grey down'
fi
#IPoE WHITE
echo "Checking IPoE white"
if is_up $IPOE_WHITE; then
if ! `/usr/local/bin/ipoe_white.sh`; then
echo "`date` ERROR! No inet on IPoE White!"
echo "`date` ERROR! No inet on IPoE White!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'ipoe white no inet'
fi
else
else
echo "`date` Error! IPoE White ($IPOE_WHITE) is DOWN!"
echo "`date` Error! IPoE White ($IPOE_WHITE) is DOWN!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'ipoe white down'
fi
#PPPoE GREY
echo "Checking PPPoE grey"
if is_up $PPPOE_GREY; then
if ! `/usr/local/bin/pppoe_grey.sh`; then
echo "`date` ERROR! No inet on PPPoE Grey!"
echo "`date` ERROR! No inet on PPPoE Grey!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'pppoe grey no inet'
fi
else
echo "`date` Error! PPPoE Grey ($PPPOE_GREY) is DOWN!"
echo "`date` Error! PPPoE Grey ($PPPOE_GREY) is DOWN!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'pppoe grey down'
fi
#PPPoE WHITE
echo "Checking PPPoE white"
if is_up $PPPOE_WHITE; then
if ! `/usr/local/bin/pppoe_white.sh`; then
echo "`date` ERROR! No inet on PPPoE White!"
echo "`date` ERROR! No inet on PPPoE White!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'pppoe white no inet'
fi
else
echo "`date` Error! PPPoE White ($PPPOE_WHITE) is DOWN!"
echo "`date` Error! PPPoE White ($PPPOE_WHITE) is DOWN!" >> $LOG
/sbin/route del default
/sbin/route add default gw 192.168.1.105
/usr/local/bin/sms.php 'ppoe white down'
fi
route del default
#route add default gw 192.168.1.105
echo "Test ended"
Маршрутизатор Juniper MX104 имеет более мощный процессор по сравнению с MX80, а также поддерживает 6 млн. маршрутов RIB, 2.2 млн маршрутов FIB против 4 млн. маршрутов RIB, 1. млн маршрутов FIB