Skip to content

Commit

Permalink
Support alternative preset file. (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljosha Papsch authored Oct 11, 2021
1 parent 3c55f2b commit 1602af0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ The following command line options are allowed:

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

- `-f <file>` Use alternative preset file

- `-c` Clear the limits from adapter

- `-s` Show the current status of adapter
Expand All @@ -113,3 +115,5 @@ Some examples:
wondershaper -a eth1 -u 94000 # only limit upload

wondershaper -c -a eth0

wondershaper -p -f foo.conf
5 changes: 4 additions & 1 deletion wondershaper
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ OPTIONS:
-d <rate> Set maximum download rate (in Kbps) and/or
-u <rate> Set maximum upload rate (in Kbps)
-p Use presets in "$CONF"
-f <file> Use alternative preset file
-c Clear the limits from adapter
-s Show the current status of adapter
-v Show the current version
Expand All @@ -60,6 +61,7 @@ EXAMPLES:
wondershaper -a eth0 -d 1024 -u 512
wondershaper -a eth0 -u 512
wondershaper -c -a eth0
wondershaper -p -f foo.conf
EOF
}
Expand All @@ -70,12 +72,13 @@ IFACE="";
IFB="ifb0";
MODE="";

while getopts hvd:u:a:pcs o; do
while getopts hvf:d:u:a:pcs o; do
case "$o" in
h) usage;
exit 1;;
v) echo "Version $VERSION";
exit 0;;
f) CONF="$OPTARG";;
d) DSPEED="$OPTARG";;
u) USPEED="$OPTARG";;
a) IFACE="$OPTARG";;
Expand Down

0 comments on commit 1602af0

Please sign in to comment.