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 >> class.nc

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

class download eth1 computer11
match dstip 192.168.2.11
htb prio 2
class upload eth0 computer11
match srcip 192.168.2.11
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

Tags: , ,

Wednesday, June 18th, 2008 Linux, Tips, cribs

3 Comments to niceshaper class file generator

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

  2. Blackhatseo on July 22nd, 2008
  3. Hi,

    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 yahoo.co.uk

  4. Darius on August 4th, 2008
  5. marti at thinkspire.org

    niceshaper has rather clear documentation:

    http://niceshaper.jedwabny.net/page/en/documentation

    if any doubts, mail me please

  6. Marcin Rybak on August 5th, 2008

Leave a comment