[package] update multiwan to 1.0.18 (#7792)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@23011 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2010-09-11 18:38:29 +00:00
parent c09a4e6d90
commit 33abb314c0
2 changed files with 761 additions and 781 deletions

View File

@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=multiwan
PKG_VERSION:=1.0.17
PKG_RELEASE:=0
PKG_VERSION:=1.0.18
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk

View File

@ -11,7 +11,7 @@ fi
}
mwnote() {
logger "[Multi-WAN Notice]: $1"
logger ${debug:+-s} -p 5 -t multiwan "$1"
}
failover() {
@ -104,8 +104,6 @@ else
fi
fi
}
recover_wan() {
@ -237,7 +235,6 @@ echo "wan_recovery_map=\"$wan_recovery_map\"" >> /tmp/.mwan/cache
}
query_config() {
case $1 in
update) update_cache_data;;
ifname) echo $wan_if_map | grep -o "$2\[\w*.*\]" | awk -F "[" '{print $2}' | awk -F "]" '{print $1}';;
@ -251,13 +248,9 @@ esac
}
mwan_kill() {
local otherpids
local execute
otherpids=$(ps -a 2>&1 | grep 'multiwan agent' | grep -v $$ | awk -F " " '{print $1}')
echo "$otherpids" | while read execute
do
kill -9 ${execute} > /dev/null 2>&1
done
local otherpids=$(ps 2>&1 | grep 'multiwan agent' | grep -v $$ | awk '{print $1}')
[ -n "$otherpids" ] && kill $otherpids > /dev/null 2>&1
sleep 2
}
stop() {
@ -273,8 +266,8 @@ echo "## Refreshing Interfaces ##"
while [ $i -lt $wancount ]; do
i=`expr $i + 1`
group=$(query_config group $i)
fdown $group > /dev/null 2>&1
ifup $group > /dev/null 2>&1 &
# ifdown $group > /dev/null 2>&1
ifup $group > /dev/null 2>&1
done
echo "## Unloaded, updating syslog and exiting. ##"
@ -428,11 +421,10 @@ mwanrule() {
config_get src $1 src
config_get dst $1 dst
config_get port_type $1 port_type 'dports'
config_get ports $1 ports
config_get proto $1 proto
config_get wanrule $1 wanrule
ports_first=${ports%-*}
ports_last=${ports#*-}
if [ -z "$wanrule" ]; then
return
@ -454,9 +446,6 @@ mwanrule() {
fi
if [ "$ports" == "all" ]; then
ports=$NULL
fi
if [ "$ports_first" -ne "$ports_last" ]; then
ports="$ports_first:$ports_last"
fi
add_rule() {
if [ "$proto" == "icmp" ]; then
@ -469,7 +458,7 @@ mwanrule() {
${proto:+-p $proto} \
${src:+-s $src} \
${dst:+-d $dst} \
${ports:+--dport $ports} \
${ports:+-m multiport --$port_type $ports} \
-j $wanrule
}
if [ -z "$proto" -a ! -z "$ports" ]; then
@ -518,8 +507,7 @@ fi
dns=$(echo $dns | sed -e "s/ /\n/g")
if [ ! -z "$dns" -a "$failchk" != "x" -a "$ipaddr" != "x" -a "$gateway" != "x" -a "$ifname" != "x" ]; then
echo "$dns" | while read dns_server
do
echo "$dns" | while read dns_server; do
iptables -t mangle -A MultiWanDNS -d $dns_server -p tcp --dport 53 -j FW${i}MARK
iptables -t mangle -A MultiWanDNS -d $dns_server -p udp --dport 53 -j FW${i}MARK
@ -554,8 +542,7 @@ iptables -t mangle -F FORWARD
iptables -t mangle -F POSTROUTING
iptables -t mangle -F OUTPUT
echo "$IMQ_NFO" | while read execute
do
echo "$IMQ_NFO" | while read execute; do
iptables -t mangle -A PREROUTING -i $(echo $execute | awk -F " " '{print $1}') -j IMQ --todev $(echo $execute | awk -F " " '{print $2}')
done
@ -595,7 +582,7 @@ if [ -z "$CHKFORMODULE" ]; then
iptables -t mangle -A FastBalancer -j MARK --set-mark 0x2
iptables -t mangle -A FastBalancer -j CONNMARK --save-mark
else
mwnote "Performance load balancer(fastbalanacer) is unavailable due to current kernel limitations.."
mwnote "Performance load balancer(fastbalanacer) is unavailable due to current kernel limitations."
iptables -t mangle -A FastBalancer -j MARK --set-mark 0x1
iptables -t mangle -A FastBalancer -j CONNMARK --save-mark
fi
@ -659,10 +646,8 @@ echo "## Refreshing Load Balancer ##"
ip rule del prio 9 > /dev/null 2>&1
ip route flush table 170 > /dev/null 2>&1
for TABLE in 170
do
ip route | grep -Ev ^default | while read ROUTE
do
for TABLE in 170; do
ip route | grep -Ev ^default | while read ROUTE; do
ip route add table $TABLE to $ROUTE
done
done
@ -737,8 +722,7 @@ local i
echo "## Refreshing Routing Tables ##"
i=0
while [ $i -lt $wancount ]
do
while [ $i -lt $wancount ]; do
i=`expr $i + 1`
group=$(query_config group $i)
gateway=$(query_config gateway $group)
@ -746,10 +730,8 @@ ifname=$(query_config ifname $group)
ipaddr=$(query_config ipaddr $group)
ip route flush table $(expr $i + 170) > /dev/null 2>&1
for TABLE in $(expr $i + 170)
do
ip route | grep -Ev ^default | while read ROUTE
do
for TABLE in $(expr $i + 170); do
ip route | grep -Ev ^default | while read ROUTE; do
ip route add table $TABLE to $ROUTE
done
done
@ -947,8 +929,7 @@ if [ "$icmp_hosts" != "disable" -a "$ifname" != "x" -a "$ipaddr" != "x" -a "$gat
icmp_hosts=$(echo $icmp_hosts_acquire | sed -e "s/\,/ /g" | sed -e "s/ /\n/g")
ping_test() {
echo "$icmp_hosts" | while read icmp_test_host
do
echo "$icmp_hosts" | while read icmp_test_host; do
ping -c 1 -W $timeout -I $ifname $icmp_test_host 2>&1 | grep -o "round-trip"
done
}
@ -1005,8 +986,7 @@ if [ -f $jobfile ]; then
mv $jobfile $jobfile.work
while read LINE
do
while read LINE; do
execute_task() {
case $2 in