Changeset 21414


Ignore:
Timestamp:
2010-05-10T04:04:52+02:00 (7 years ago)
Author:
craigc
Message:

[packages] multiwan: Changed failover probabilities for
MultiWanLoadBalancer

Location:
packages/net/multiwan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/multiwan/Makefile

    r21413 r21414  
    99 
    1010PKG_NAME:=multiwan 
    11 PKG_VERSION:=1.0.5 
     11PKG_VERSION:=1.0.6 
    1212PKG_RELEASE:=1 
    1313 
  • packages/net/multiwan/files/usr/bin/multiwan

    r21413 r21414  
    665665i=`expr $i + 1`  
    666666group=$(query_config group $i) 
     667failchk=$(query_config failchk $group) 
     668gateway=$(query_config gateway $group) 
     669ifname=$(query_config ifname $group) 
    667670weight=`uci -q -P /var/state get multiwan.${group}.weight` 
    668 total_weight=$(expr $total_weight + $weight) 
     671        if [ "$gateway" != "x" -a "$ifname" != "x" -a "$failchk" != "x" -a "$weight" != "disable" ]; then 
     672                total_weight=$(expr $total_weight + $weight) 
     673        fi 
    669674done 
    670675 
     
    683688rand_probability=$(expr $(expr $weight \* 100) / $total_weight) 
    684689 
    685         if [ $rand_probability -lt 10 ]; then 
    686                 rand_probability="0.0${rand_probability}" 
    687         else  
    688                 rand_probability="0.${rand_probability}" 
    689         fi 
     690        if [ $rand_probability -lt 10 ]; then 
     691                rand_probability="0.0${rand_probability}" 
     692        elif [ $rand_probability -lt 100 ]; then 
     693                rand_probability="0.${rand_probability}" 
     694        else 
     695                rand_probability="1.0" 
     696        fi 
    690697 
    691698        if [ -z "$CHKFORMODULE" ]; then 
Note: See TracChangeset for help on using the changeset viewer.