#!/bin/bash
ip route replace default equalize nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 1 nexthop dev ppp2 weight 1
LOOP1="7"
while (true)
do
LOOP="0"
if [ "`ifconfig | awk -F"[ :]" '/ppp0/{print $1}'`" = "ppp0" ]; then
LOOP=`expr $LOOP + 1`
fi
if [ "`ifconfig | awk -F"[ :]" '/ppp1/{print $1}'`" = "ppp1" ]; then
LOOP=`expr $LOOP + 2`
fi
if [ "`ifconfig | awk -F"[ :]" '/ppp2/{print $1}'`" = "ppp2" ]; then
LOOP=`expr $LOOP + 4`
fi
if [ $LOOP1 -ne $LOOP]; then
case "$LOOP" in
0) /root/ipt.sh
;;
1) ip route replace default via 221.218.168.1
;;
2) ip route replace default via 221.218.168.1
;;
3) ip route replace default equalize nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 1
;;
4) ip route replace default via 221.218.168.1
;;
5) ip route replace default equalize nexthop dev ppp0 weight 1 nexthop dev ppp2 weight 1
;;
6) ip route replace default equalize nexthop dev ppp1 weight 1 nexthop dev ppp2 weight 1
;;
7) ip route replace default equalize nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 1 nexthop dev ppp2 weight 1
;;
esac
ip route flush cache
fi
LOOP1="$LOOP"
sleep 3
done
阅读(1885) | 评论(1) | 转发(0) |