#!/bin/sh

#IP=$1
#DOWNSPEED=$2
#UPSPEED=$3

#echo $IP
#echo $DOWNSPEED
#echo $UPSPEED

INDEV="eth0"
OUTDEV="eth0"

IP=$1
CLASS_DOWN=$2
CLASS_UP=$3

echo $IP
echo $CLASS_DOWN 
echo $CLASS_UP 


##### speed server->client(downstream)
command="/sbin/tc filter add dev $INDEV parent 1:0 protocol ip prio 1 u32 match ip dst $IP  flowid 1:$CLASS_DOWN"
echo $command >> shape.out
$command
### speed client->server(upstream)
command="/sbin/tc filter add dev $OUTDEV parent 1:0 protocol ip prio 2 u32 match ip src $IP flowid 1:$CLASS_UP"
echo $command >> shape.out
$command
