1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge pull request #256 from Ysurac/develop

sync
This commit is contained in:
suyuan 2022-07-23 16:04:37 +08:00 committed by GitHub
commit 2e3060a54f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 1 deletions

View file

@ -104,7 +104,7 @@ omr_set_settings() {
tc qdisc del dev ${ifname} root netem 2>&1 >/dev/null
fi
if [ "$addlatency" != "0" ]; then
if [ "$(tc qdisc show dev $ifname | grep delay)" != "" ]; then
if [ "$(tc qdisc show dev $ifname | grep delay)" = "" ]; then
tc qdisc add dev ${ifname} root netem delay ${addlatency}ms 2>&1 >/dev/null
elif [ "$(tc qdisc show dev $ifname | awk '/delay/ { print $10 }' | sed 's/ms//')" != "$addlatency" ]; then
tc qdisc replace dev ${ifname} root netem delay ${addlatency}ms 2>&1 >/dev/null