Új hozzászólás Aktív témák

  • Speeedfire

    nagyúr

    Valaki foglalkozott jobban már a luci-val?
    Ki szeretném nyerni az aktuális forgalmi sebességeket, de nem megy.

    Ha jól értem, akkor ez hivatott ezt megoldani:

    function action_bandwidth(iface)
    luci.http.prepare_content("application/json")

    local bwc = io.popen("luci-bwc -i %q 2>/dev/null" % iface)
    if bwc then
    luci.http.write("[")

    while true do
    local ln = bwc:read("*l")
    if not ln then break end
    luci.http.write(ln)
    end

    luci.http.write("]")
    bwc:close()
    end
    end

    Az iface paraméter okés, de mi lehet a %q? Ha a %q helyére is egy interface-t írok, akkor nem ad vissza semmi eredményt. :(

    Fotóim https://fb.com/toth.szabolcs.art || IG: http://instagram.com/_tothszabolcs_ || Weblapom http://szabolcs-toth.com

Új hozzászólás Aktív témák