What's new

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

  • Thread starter Deleted member 27741
  • Start date
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

D

Deleted member 27741

Guest
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!
 
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 by a moderator:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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