środa, 18 czerwca 2008

niceshaper class file generator

Because I found rather impossible to write almost 100 entries into my class.ns file (form niceshaper 0.6), I did really easy oneliner to to this :)... proof of concept, but you can easly use it.
for i in `seq 10 100`; do echo -e "class download eth1 computer$i \n match dstip 192.168.2.$i \n htb prio 2 \nclass upload eth0 computer$i \n match srcip 192.168.2.$i \n htb prio 2 \n"; done >>

and the output simple output looks like this (one entry)

class download eth1 computer11
match dstip
htb prio 2
class upload eth0 computer11
match srcip
htb prio 2

you need explanation? OK...

seq x y - make sequential output from x to y, so if your IP class is from 22 to 38 change it to seq 22 38

everything else is based at number generated from seq so the computerXX identifier is same as its end of IP address, which for me is not a big problem, but there is no problem to take an entries form cat users.txt

3 komentarze:

Blackhatseo pisze...

Added. Nice work on this one. Btw, my blog is dofollow, stop by and grab a link. Walter

Darius pisze...


your Niceshaper configuration.

Could you tell how to set Niceshaper to work with Hotspot
to manage bandwidth for a number of Wifi www clients.

Pls tell me how to contct you by e-mail.

dariusjack at

Marcin Rybak pisze...

marti at

niceshaper has rather clear documentation:

if any doubts, mail me please