Scripts to set qos/bandwidth limiter to active/suspended not working.

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

000111

Senior Member
Hey all, been a long time since I rapped at ya.

I use bandwidth limiter a lot so it would be very nice to be able to script some gui actions.

I have a script that is supposed to make the bandwidth limiter "active" or "suspended." It does not work. Here is the script:

#!/bin/sh
# echo $PATH | grep -q "\/sbin" || export PATH=$PATH:/sbin:/usr/sbin
logger -p 1 -t $(basename $0) "STARTING SCRIPT, PARAMETER: $1"
nvram show|grep qos_suspend
nvram set qos_suspend=1
nvram committ
service stop_qos
sleep 5
service start_qos

I have another script to do the opposite (set qos_suspend=0).
These scripts do not work and this is what the log says when I run them:
Jan 24 15:24:04 qossuspend.sh: STARTING SCRIPT, PARAMETER:
Jan 24 15:24:07 rc_service: service 2081:notify_rc stop_qos
Jan 24 15:24:12 rc_service: service 2115:notify_rc start_qos
Jan 24 15:24:12 qos-rules: apply rules (/tmp/mangle_rules) success!
Jan 24 15:24:12 qos-init: using wan_ifname eth0
Jan 24 15:24:12 qos-init: bwl start complete

Of course, setting things through the gui works and this is what the log has to say about that:
Jan 24 15:25:12 rc_service: httpd 470:notify_rc stop_qos
Jan 24 15:25:27 rc_service: httpd 470:notify_rc start_qos
Jan 24 15:25:27 qos-rules: apply rules (/tmp/mangle_rules) success!
Jan 24 15:25:27 qos-init: using wan_ifname eth0
Jan 24 15:25:27 qos-init: bwl start complete

I am missing something you geniuses can figure out. Help a dumb guy out today!
 

dave14305

Part of the Furniture
Last edited:

000111

Senior Member
BUT I WANTED TO STOP QOS FOR ONLY FIVE SECONDS.

I kid. Trying the code out with just stop to turn it off and just start to turn it on now. Thanks!

The clarification was all I needed. Qos on/off from my desktop with plink is nice. Thanks my man.

Qos off script:

#!/bin/sh
# echo $PATH | grep -q "\/sbin" || export PATH=$PATH:/sbin:/usr/sbin
logger -p 1 -t $(basename $0) "STARTING SCRIPT, PARAMETER: $1"
nvram show|grep qos_suspend
nvram set qos_suspend=1
nvram committ
service stop_qos

Qos on script:

#!/bin/sh
# echo $PATH | grep -q "\/sbin" || export PATH=$PATH:/sbin:/usr/sbin
logger -p 1 -t $(basename $0) "STARTING SCRIPT, PARAMETER: $1"
nvram show|grep qos_suspend
nvram set qos_suspend=0
nvram committ
service start_qos
 
Last edited:

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top