Skip to content

Commit

Permalink
Added .conf file for use with systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
magnific0 committed Mar 6, 2013
1 parent fdb2314 commit 25bc2f4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ wondershaper:
exit
install:
install -Dm744 wondershaper /usr/bin/wondershaper
install -Dm644 wondershaper.service /usr/lib/systemd/system/wondershaper.service
install -Dm644 wondershaper.conf /etc/conf.d/wondershaper.conf
clean:
rm -f wondershaper
12 changes: 12 additions & 0 deletions wondershaper.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[wondershaper]
# Adapter
#
IFACE="eth0"

# Download rate in Kbps
#
DSPEED="2048"

# Upload rate in Kbps
#
USPEED="512"
14 changes: 14 additions & 0 deletions wondershaper.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Bandwidth shaper/Network rate limiter
After=network.target
Wants=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/wondershaper.conf
ExecStart=/usr/bin/wondershaper -a $IFACE -d $DSPEED -u $USPEED
ExecStop=/usr/bin/wondershaper -c -a $IFACE

[Install]
WantedBy=multi-user.target

0 comments on commit 25bc2f4

Please sign in to comment.