Changeset 2363


Ignore:
Timestamp:
Jan 3, 2014, 12:15:26 PM (5 years ago)
Author:
matthijs
Message:

luci: Pass the PIN to udiald --probe

When probing, the network config hasn't been built by /lib/fon/config.sh
yet, so udiald can't take the PIN from there. To allow probing PIN
protected devices, pass it on the commandline instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/luci/modules/admin-fon/luasrc/controller/fon_admin/fon_devices.lua

    r2307 r2363  
    113113
    114114function umts_probe()
    115         device_id = luci.http.formvalue('device_id')
    116         local probe_output = luci.util.exec("udiald --probe --device-id " ..  device_id .. " 2>&1")
     115        local device_id = luci.http.formvalue('device_id')
     116        local uci = require "luci.model.uci".cursor()
     117        local pin = uci:get("fon", "advanced", "umts_pin")
     118        local probe_output = luci.util.exec("udiald --probe --pin " .. pin .. " --device-id " ..  device_id .. " 2>&1")
    117119        luci.http.prepare_content("text/html")
    118120        luci.template.render("fon_umtsd/probe", {probe_output=probe_output})
Note: See TracChangeset for help on using the changeset viewer.