1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SES button: toggle QoS on/off

Discussion in 'Tomato Firmware' started by AVT_, Aug 6, 2009.

  1. AVT_

    AVT_ Addicted to LI Member

    Hi,

    I've been trying to write a script that would turn QoS on/off and have the white LED on if QoS is off. Here's what I have so far:

    #!/bin/bash

    if [ $(nvram get qos_enable) == 0 ]; then
    nvram set qos_enable=1
    /etc/qos start
    led white off
    else
    nvram set qos_enable=0
    /etc/qos stop
    led white on
    fi

    Here's the problem: while this DOES turn QoS itself on/off, it doesn't affect the graphs, and other stuff. IE, if I turn QoS on via button, graphs will not update. They'll also continue to update if I turn it off via button.

    I'm not too familiar with Tomato, but I'm sure there's probably a better way to turn QoS on/off than I'm using?

    Thanks in advance!
     
  2. rhester72

    rhester72 Network Guru Member

    Try "service qos restart" if you want to continue to use your NVRAM approach, otherwise you can just use "service qos stop" and "service qos start" and use a zero-byte flag-file check in /tmp instead of checking the current state of the NVRAM variable (though the current state will not be persisted across reboots - your current approach won't either unless you "nvram commit" after each set, which is kinda hard on the flash).

    If you're actually looking at the QoS graph when you do this, I suspect you will need to (at minimum) refresh the page in order to pick up the change, though.

    Rodney
     
  3. AVT_

    AVT_ Addicted to LI Member

    Actually, I'd like it to always start up with QoS on, so that's not a problem. Didn't know I could use "service qos restart". Thanks!

    As for the graphs, I'd simply like for them to respond as they would had I manually clicked the checkbox for QoS. The problem with the graphs is this:

    If I turn QoS off via the SES button, the graphs continue to update and classify the traffic, even though they shouldn't be. Similarly, if it was originally off (via the checkbox) and I turn it on via the button, the graphs don't update at all. Maybe there's a something that needs to be restarted for them to reflect the current state of the system?
     

Share This Page