Changeset 2309


Ignore:
Timestamp:
Sep 2, 2013, 4:25:17 PM (5 years ago)
Author:
matthijs
Message:

udiald: Allow setting the verbosity from luci

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/fon/fonbase/files/lib/fon/config.sh

    r2308 r2309  
    319319                        uci_set "network" "wan" "udiald_pass" $(config_get advanced umts_pass)
    320320                        uci_set "network" "wan" "udiald_mode" $(config_get advanced umts_mode)
     321                        uci_set "network" "wan" "udiald_verbosity" $(config_get advanced umts_verbosity)
    321322                        config_get dns advanced umts_dns
    322323                        if [ "$dns" = "0" ]; then # Use provider default DNS
  • trunk/fon/udiald/files/lib/network/umts.sh

    r2276 r2309  
    99
    1010setup_interface_umts() {
     11        FLAGS=""
     12        if [ "$(uci get registered.fonreg.dev)" = "1" ]; then
     13          verbosity=$(config_get "$2" udiald_verbosity)
     14          [ "$verbosity" -gt "0" ] && FLAGS="$FLAGS --verbose"
     15          [ "$verbosity" -gt "1" ] && FLAGS="$FLAGS --verbose"
     16        fi
     17
    1118        # Run udiald to setup the modem and run pppd
    12         udiald --network-name "$2" --device-id "$(config_get "$2" udiald_device)" &
     19        udiald --network-name "$2" --device-id "$(config_get "$2" udiald_device)" $FLAGS &
    1320}
  • trunk/luci/modules/admin-fon/luasrc/model/cbi/fon_umts/configure.lua

    r2300 r2309  
    11require("luci.tools.webadmin")
    22
     3local uci = luci.model.uci.cursor()
    34local util = require "luci.util"
    45local pdb = loadfile((os.getenv("LUCI_SYSROOT") or "") .. "/etc/3gsp.db.lua")()
    56local c3166 = loadfile((os.getenv("LUCI_SYSROOT") or "") .. "/etc/3166en.db.lua")()
     7local dev = uci:get("registered", "fonreg", "dev") == "1"
    68
    79local m = Map("fon",
     
    137139auto:value("1", translate("umts_auto_connect", "connect automatically"))
    138140
     141if dev then
     142  verbosity = s:option(ListValue, "umts_verbosity", translate("umts_verbosity", "Log verbosity"))
     143  verbosity.default = "0"
     144  verbosity:value("0", translate("umts_verbosity_normal", "normal"))
     145  verbosity:value("1", translate("umts_verbosity_verbose", "verbose"))
     146  verbosity:value("2", translate("umts_verbosity_debug", "debug"))
     147end
     148
    139149return m, n
Note: See TracChangeset for help on using the changeset viewer.