17 #Selected dirs to connect
22 # =========== shaping by tariff ===========
23 #tariff=$(grep -i "^tariff=" /var/stargazer/users/$LOGIN/conf | cut -f 2 -d"=")
24 #echo "tariff=$tariff" > /var/stargazer/users/$LOGIN/connect.log
26 # minimum) speedkb=128kbit;; # 128 kbit
27 # middle) speedkb=256kbit;; # 256 kbi
28 # maximum) speedkb=512kbit;; # 512 kbit
29 # *) speedkb=$default_speed;; # default speed
31 # ========= shaping by tariff end =========
33 # ========= shaping by userdata0 ==========
34 speedR=$(grep -i "^Userdata0=" /var/stargazer/users/$LOGIN/conf | cut -f 2 -d"=")
35 speed=$(echo $speedR | grep "^[0-9]*[0-9]$")
39 speedkb=$default_speed
43 # ======= shaping by userdata0 end ========
45 declare -i mark=$ID+10
47 echo "$mark" > /var/stargazer/users/$LOGIN/shaper_mark
48 echo "$speedkb" > /var/stargazer/users/$LOGIN/shaper_rate
50 iptables -t mangle -A FORWARD -d $IP -j MARK --set-mark $mark
52 tc class add dev $int_iface parent 1:1 classid 1:$mark htb rate $speedkb burst 40k
53 tc filter add dev $int_iface parent 1: protocol ip prio 3 handle $mark fw classid 1:$mark