Changeset 21431
 Timestamp:
 20100512T22:54:57+02:00 (8 years ago)
 Location:
 packages/net/multiwan
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

packages/net/multiwan/Makefile
r21424 r21431 9 9 10 10 PKG_NAME:=multiwan 11 PKG_VERSION:=1.0. 811 PKG_VERSION:=1.0.11 12 12 PKG_RELEASE:=1 13 13 
packages/net/multiwan/files/usr/bin/multiwan
r21424 r21431 640 640 local total_weight 641 641 local total_wans 642 local roundme 643 local roundlen 642 644 local i 643 645 local x 644 local y646 local n 645 647 646 648 echo "## Refreshing Load Balancer ##" … … 661 663 done 662 664 665 iptables F MultiWanLoadBalancer t mangle 666 663 667 total_weight=0 664 668 total_wans=0 665 last_probability=0666 x=0667 y=0668 669 iptables F MultiWanLoadBalancer t mangle670 669 671 670 i=0 … … 683 682 done 684 683 684 last_probability=0 685 roundme=0 686 roundlen=0 687 x=0 688 n=0 689 685 690 i=0 686 691 while [ $i lt $wancount ]; do … … 695 700 if [ "$gateway" != "x" a "$ifname" != "x" a "$failchk" != "x" a "$weight" != "disable" ]; then 696 701 nexthop="$nexthop nexthop via $gateway dev $ifname weight $weight" 697 y=$last_probability 698 last_probability=$(expr $x / $(expr $wancount  $i + 1)) 699 rand_probability=$(expr $(expr $(expr $weight \* 100) / $total_weight) + $last_probability + $y) 702 703 n=$(expr $n + $last_probability) 704 last_probability=$(expr $x / $(expr $total_wans  $i + 1)) 705 rand_probability=$(expr $(expr $weight \* 1000) / $total_weight) 706 roundlen=`expr length $rand_probability  1` 707 roundme=${rand_probability:$roundlen} 708 rand_probability=$(echo $rand_probability  sed s/$roundme//) 709 710 if [ $roundme ge 5 ]; then 711 rand_probability=$(expr $rand_probability + 1) 712 fi 713 714 rand_probability=$(expr $rand_probability + $n + $last_probability) 700 715 x=$rand_probability 701 716 702 717 if [ $rand_probability lt 10 ]; then 703 718 rand_probability="0.0${rand_probability}" 704 elif [ $rand_probability lt 100 a $i != $total_wans]; then719 elif [ $rand_probability lt 100 ]; then 705 720 rand_probability="0.${rand_probability}" 706 721 else
Note: See TracChangeset
for help on using the changeset viewer.