Skip to content

Commit

Permalink
support for high priority hosts, shellcheck, consistent syntax, ... (#42
Browse files Browse the repository at this point in the history
)

* shellcheck, consistent shell syntax, adapt paths for Debian

Signed-off-by: corbolais <corbolais@gmail.com>

* compactify

Signed-off-by: corbolais <corbolais@gmail.com>

* Debian path

Signed-off-by: corbolais <corbolais@gmail.com>

* add support for high priority hosts

Signed-off-by: corbolais <corbolais@gmail.com>

* correct tailing w/s

Signed-off-by: corbolais <corbolais@gmail.com>

* consistent paths, editor vim, enable and start in one systemctl call

Signed-off-by: corbolais <corbolais@gmail.com>

* rem unused variable

Signed-off-by: corbolais <corbolais@gmail.com>

* doc changes

Signed-off-by: corbolais <corbolais@gmail.com>

* bump version to 1.4.1

Signed-off-by: corbolais <corbolais@gmail.com>

* bump version

Signed-off-by: corbolais <corbolais@gmail.com>

* chg copyright notice

Signed-off-by: corbolais <corbolais@gmail.com>

* rem useless var definition, use several vars from ENV, add those to config file

Signed-off-by: corbolais <corbolais@gmail.com>

* rem useless quoting

Signed-off-by: corbolais <corbolais@gmail.com>

* use vars from ENV, add them to config file, bump version, chmod 755

Signed-off-by: corbolais <corbolais@gmail.com>

* add config directive hint

Signed-off-by: corbolais <corbolais@gmail.com>

Co-authored-by: Jacco <jacco@geul.net>
  • Loading branch information
corbolais and magnific0 authored Mar 31, 2020
1 parent 109a5af commit aefdca0
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 203 deletions.
16 changes: 12 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changes since version 1.4.1 - <corbolais@gmail.com>:
- Use Debian paths
- clean up w/s
- add high priority host support
- remove unused var
- shellcheck
- consistent shell syntax

Changes since version 1.4 - Jacco Geul <jacco@geul.net>:
- download limiting has been added from (removed in 1.3), it had to be
reworked the script now directs ingress to ifb virtual interface where
- download limiting has been added from (removed in 1.3), it had to be
reworked the script now directs ingress to ifb virtual interface where
it is properly limited. Source for this work are:
- https://gist.github.com/ole1986/d9d6be5218affd41796610a35e3b069c
- https://wiki.archlinux.org/index.php/advanced_traffic_control
Expand All @@ -14,8 +22,8 @@ Changes since version 1.3 - Simon Séhier <simon@sehier.fr>:
any caveats on SIP telephony or link reactivity.

Changes since version 1.2 - Jacco Geul <jacco@geul.net>:
- added command-line interface (through options and flags)
that didn't seem to be working before as the options were
- added command-line interface (through options and flags)
that didn't seem to be working before as the options were
hardcoded in the script.

Changes since version 1.1 - Bert Hubert <ahu@ds9a.nl>:
Expand Down
File renamed without changes.
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
The Wonder Shaper 1.4
The Wonder Shaper 1.4.1
==============

Copyright
-------------

Copyright (c) 2002-2017 Bert Hubert <ahu@ds9a.nl>, Jacco Geul <jacco@geul.net>, Simon Séhier <simon@sehier.fr>
Copyright (c) 2002-2020 Bert Hubert <ahu@ds9a.nl>, Jacco Geul <jacco@geul.net>, Simon Séhier <simon@sehier.fr>, <corbolais@gmail.com>

See the ChangeLog for information on the individual contributions of the authors.

Expand All @@ -25,17 +25,17 @@ It is recommended to clone the GitHub repository of wondershaper such that you c
This will clone wondershaper in your current folder in a new folder named wondershaper. Now enter the folder using

cd wondershaper

### Using wondershaper

You can run wondershaper (as any user with sufficient permissions) without installation and stop following the instructions at this point. Show the wondershaper usage instructions by typing

./wondershaper -h

The program details all available options on how to use wondershaper. Next is to pick an interface that you want to shape. You can see all availble interfaces by typing

ip addr show

Note that on older systems this command might not be available. In this case you should run ```ifconfig``` instead.

Identify the network interface that you want to shape. The names [differ per system](https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/).
Expand All @@ -47,31 +47,32 @@ In the following example a wireless interface is limited to an [upload of 4Mbps
If you get messages telling you that ```RTNETLINK answers: Operation not permitted``` your user account does not have sufficient privileges. In that case try:

sudo ./wondershaper -a wlp4s0 -u 4096 -d 8192

### System installation (optional)

A makefile file provided for easy installation. The default location for wondershaper is in ```/usr/bin```. If you want to install to your system you can run:

sudo make install

You can verify that wondershaper was installed correctly by entering:

which wondershaper

This should return ```/usr/bin/wondershaper```. You can follow the same instructions as explained in the "Using wondershaper" section, but instead of running the local version of the program you now run the system version by removing the ```./``` from the beginning of each command. For example to show the help instructions again run:

wondershaper -h

### Persistent usage of wondershaper (optional)


Instead of using the commandline options to set the rates and interface as previously shown, it is necessary to set these parameters in the ```wondershaper.conf``` configuration file. You can edit this file using your favourite text editor (vim in the example below) as such:

sudo vim /etc/systemd/wondershaper.conf

To make sure wondershaper is reactivated on reboot a systemd service file is provided. First enable wondershaper as a systemd service using:

sudo systemctl enable wondershaper.service

Instead of using the commandline options to set the rates and interface as previously shown, it is necessary to set these parameters in the ```wondershaper.conf``` configuration file. You can edit this file using your favourite text editor (nano in the example below) as such:
sudo systemctl enable --now wondershaper.service

sudo nano /etc/conf.d/wondershaper.conf

This way wondershaper is activated with your setting upon reboot.

Usage
Expand All @@ -89,7 +90,7 @@ The following command line options are allowed:

- `-u <rate>` Set maximum upload rate (in Kbps)

- `-p` Use the presets in /etc/conf.d/wondershaper.conf
- `-p` Use the presets in /etc/systemd/wondershaper.conf

- `-c` Clear the limits from adapter

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1.4
1.4.1

19 changes: 11 additions & 8 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
wondershaper:
exit
exit;

install:
install -Dm755 wondershaper /usr/bin/wondershaper
install -Dm644 wondershaper.service /usr/lib/systemd/system/wondershaper.service
install -Dm644 wondershaper.conf /etc/conf.d/wondershaper.conf
install -Dm755 wondershaper /usr/sbin/wondershaper;
install -Dm644 wondershaper.service /etc/systemd/system/wondershaper.service;
install -Dm644 wondershaper.conf /etc/systemd/wondershaper.conf;

uninstall:
rm -f /usr/bin/wondershaper
rm -f /usr/lib/systemd/system/wondershaper.service
rm -f /etc/conf.d/wondershaper.conf
rm -f /usr/sbin/wondershaper;
rm -f /usr/lib/systemd/system/wondershaper.service;
rm -f /etc/conf.d/wondershaper.conf;

clean:
rm -f wondershaper
rm wondershaper;
Loading

0 comments on commit aefdca0

Please sign in to comment.