Skip to content

Instantly share code, notes, and snippets.

@ffund
Last active February 21, 2020 13:59
Show Gist options
  • Save ffund/7a02086edcbff5af7db025e08621f08d to your computer and use it in GitHub Desktop.
Save ffund/7a02086edcbff5af7db025e08621f08d to your computer and use it in GitHub Desktop.
#!/bin/bash
while IFS=, read -r tput tdiff
do
tdiff=${tdiff::-1}
#ts= `date +%s.%N`
#echo "$ts,$tdiff,$tput"
sudo tc class replace dev $(ip route get 10.0.3.1 | grep -oP "(?<=dev )[^ ]+") parent 1: classid 1:3 htb rate "$tput"mbit
sleep $tdiff
done < "$1"-tput.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment