diff -uNr wondershaper-1.1a.orig/ChangeLog wondershaper-1.1a/ChangeLog --- wondershaper-1.1a.orig/ChangeLog Tue Apr 16 10:27:44 2002 +++ wondershaper-1.1a/ChangeLog Fri Jun 28 18:14:38 2002 @@ -1,3 +1,8 @@ +Changes since version 1.1a: + - William Stearns moved the configuration + information to /etc/wshaper.conf + + Changes since version 1.1: - Georg Wild noticed that NOPRIOHOSTDST was never used diff -uNr wondershaper-1.1a.orig/README wondershaper-1.1a/README --- wondershaper-1.1a.orig/README Tue Apr 16 10:27:57 2002 +++ wondershaper-1.1a/README Fri Jun 28 18:16:51 2002 @@ -5,7 +5,7 @@ Licenced under the GPL - see 'COPYING' This document is a bit long, I'll split it up later. -The very short summary is: edit the first few lines of 'wshaper' and run it. +The very short summary is: edit '/etc/wshaper.conf' and run it. GOALS ----- @@ -119,7 +119,7 @@ NOPRIOPORTDST Set this to destination ports that should have low priority. -See the start of wshaper and wshaper.htb +See /etc/wshaper.conf Results ------- diff -uNr wondershaper-1.1a.orig/TODO wondershaper-1.1a/TODO --- wondershaper-1.1a.orig/TODO Mon Apr 15 15:50:23 2002 +++ wondershaper-1.1a/TODO Fri Jun 28 18:15:03 2002 @@ -1 +1 @@ -- move configuration away from the script itself +(nothing at this time) diff -uNr wondershaper-1.1a.orig/wshaper wondershaper-1.1a/wshaper --- wondershaper-1.1a.orig/wshaper Tue Apr 16 10:26:35 2002 +++ wondershaper-1.1a/wshaper Fri Jun 28 18:10:24 2002 @@ -1,31 +1,24 @@ #!/bin/bash # Wonder Shaper -# please read the README before filling out these values -# -# Set the following values to somewhat less than your actual download -# and uplink speed. In kilobits. Also set the device that is to be shaped. -DOWNLINK=800 -UPLINK=220 -DEV=eth0 -# low priority OUTGOING traffic - you can leave this blank if you want -# low priority source netmasks -NOPRIOHOSTSRC=80 - -# low priority destination netmasks -NOPRIOHOSTDST= - -# low priority source ports -NOPRIOPORTSRC= - -# low priority destination ports -NOPRIOPORTDST= - -# Now remove the following two lines :-) - -echo Please read the documentation in 'README' first :-\) -exit +# Load configuration information from /etc/wshaper.conf +if [ -r /etc/wshaper.conf ]; then + . /etc/wshaper.conf +else + echo /etc/wshaper.conf is missing or unreadable. Please fix >>/dev/stderr + echo and rerun. Exiting. >>/dev/stderr + exit 1 +fi + +if [ -z "$DOWNLINK" ] || \ + [ -z "$UPLINK" ] || \ + [ -z "$DEV" ]; then + echo One or more of DOWNLINK, UPLINK, or DEV is unset. >>/dev/stderr + echo Please set in /etc/wshaper.conf and rerun. Please see the + echo README if you need help with these settings. Exiting. >>/dev/stderr + exit 1 +fi ######################################################### diff -uNr wondershaper-1.1a.orig/wshaper.conf wondershaper-1.1a/wshaper.conf --- wondershaper-1.1a.orig/wshaper.conf Wed Dec 31 19:00:00 1969 +++ wondershaper-1.1a/wshaper.conf Fri Jun 28 18:42:24 2002 @@ -0,0 +1,38 @@ +#!/bin/sh + +# Wondershaper configuration file /etc/wshaper.conf +# please read the README before filling out these values +# +# Set the following values to somewhat less than your actual download +# and uplink speed. Values are in kilobits. +#DOWNLINK=800 +#UPLINK=220 +DOWNLINK= +UPLINK= + +#Set the device that is to be shaped. +#DEV=eth0 +#DEV=ppp0 +DEV= + +# low priority OUTGOING traffic - you can leave these blank if you want +# To have multiple values in any of these, separate by spaces and place +#in quotes: +#NOPRIOHOSTSRC='192.168.11.16 192.168.11.24 192.168.18.33' + +# low priority source netmasks +# Example: NOPRIOHOSTSRC='192.168.11.16' +NOPRIOHOSTSRC= + +# low priority destination netmasks +# Example: NOPRIOHOSTDST='my.mail.server.ip.address' +NOPRIOHOSTDST= + +# low priority source ports +# Example: NOPRIOPORTSRC='143' +NOPRIOPORTSRC= + +# low priority destination ports +# Example: NOPRIOPORTDST='6969' +NOPRIOPORTDST= + diff -uNr wondershaper-1.1a.orig/wshaper.htb wondershaper-1.1a/wshaper.htb --- wondershaper-1.1a.orig/wshaper.htb Tue Apr 16 10:26:51 2002 +++ wondershaper-1.1a/wshaper.htb Fri Jun 28 18:11:34 2002 @@ -1,32 +1,26 @@ #!/bin/bash -# Wonder Shaper -# please read the README before filling out these values -# -# Set the following values to somewhat less than your actual download -# and uplink speed. In kilobits. Also set the device that is to be shaped. - -DOWNLINK=800 -UPLINK=220 -DEV=ppp0 - -# low priority OUTGOING traffic - you can leave this blank if you want -# low priority source netmasks -NOPRIOHOSTSRC= - -# low priority destination netmasks -NOPRIOHOSTDST= -# low priority source ports -NOPRIOPORTSRC= - -# low priority destination ports -NOPRIOPORTDST= +# Wonder Shaper +# Load configuration information from /etc/wshaper.conf +if [ -r /etc/wshaper.conf ]; then + . /etc/wshaper.conf +else + echo /etc/wshaper.conf is missing or unreadable. Please fix >>/dev/stderr + echo and rerun. Exiting. >>/dev/stderr + exit 1 +fi -# Now remove the following two lines :-) +if [ -z "$DOWNLINK" ] || \ + [ -z "$UPLINK" ] || \ + [ -z "$DEV" ]; then + echo One or more of DOWNLINK, UPLINK, or DEV is unset. >>/dev/stderr + echo Please set in /etc/wshaper.conf and rerun. Please see the + echo README if you need help with these settings. Exiting. >>/dev/stderr + exit 1 +fi -echo Please read the documentation in 'README' first -exit +######################################################### if [ "$1" = "status" ] then @@ -62,7 +56,7 @@ tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \ burst 6k prio 1 -# bulk & default class 1:20 - gets slightly less traffic, +# bulk and default class 1:20 - gets slightly less traffic, # and a lower priority: tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$UPLINK/10]kbit \