diff options
author | Christian Schoenebeck <christian.schoenebeck@gmail.com> | 2015-02-10 21:49:57 +0100 |
---|---|---|
committer | Christian Schoenebeck <christian.schoenebeck@gmail.com> | 2015-02-10 21:49:57 +0100 |
commit | 8b0f83264a5d33078eaca1f15de226cc7f984f59 (patch) | |
tree | ed4dd88b5599c23c01988a549e27704f1a7930fa /applications/luci-app-ddns/luasrc/tools/ddns.lua | |
parent | 86c627224091bb4ea6df961470464f5ed1748d07 (diff) |
luci-app-ddns: update to version 2.2.0-1
- implement new option bind_interface
- fixes problems when updating status displays (i.e. showing Software update needed)
- new links to OpenWrt wiki
- new screen to set global settings
- implements global option use_curl
Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Diffstat (limited to 'applications/luci-app-ddns/luasrc/tools/ddns.lua')
-rw-r--r-- | applications/luci-app-ddns/luasrc/tools/ddns.lua | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/applications/luci-app-ddns/luasrc/tools/ddns.lua b/applications/luci-app-ddns/luasrc/tools/ddns.lua index 2fbcff8ba..e9c3fa936 100644 --- a/applications/luci-app-ddns/luasrc/tools/ddns.lua +++ b/applications/luci-app-ddns/luasrc/tools/ddns.lua @@ -35,7 +35,7 @@ end -- check if Wget with SSL support or cURL installed function check_ssl() - if (SYS.call([[ grep -iq "\+ssl" /usr/bin/wget 2>/dev/null ]]) == 0) then + if (SYS.call([[ grep -i "\+ssl" /usr/bin/wget >/dev/null 2>&1 ]]) == 0) then return true else return NXFS.access("/usr/bin/curl") @@ -45,12 +45,12 @@ end -- check if Wget with SSL or cURL with proxy support installed function check_proxy() -- we prefere GNU Wget for communication - if (SYS.call([[ grep -iq "\+ssl" /usr/bin/wget 2>/dev/null ]]) == 0) then + if (SYS.call([[ grep -i "\+ssl" /usr/bin/wget >/dev/null 2>&1 ]]) == 0) then return true -- if not installed cURL must support proxy elseif NXFS.access("/usr/bin/curl") then - return (SYS.call([[ grep -iq all_proxy /usr/lib/libcurl.so* 2>/dev/null ]]) == 0) + return (SYS.call([[ grep -i all_proxy /usr/lib/libcurl.so* >/dev/null 2>&1 ]]) == 0) -- only BusyBox Wget is installed else @@ -121,6 +121,20 @@ function ipkg_ver_installed(pkg) return nil end +-- get the "name" of the current active theme +function get_theme() + local _uci = UCI.cursor() + local _base = _uci:get("luci", "main", "mediaurlbase") -- only pathname + _uci:unload("luci") + + for k, v in pairs(luci.config.themes) do + if k:sub(1, 1) ~= "." and v == _base then + return k + end + end + return nil +end + -- replacement of build-in read of UCI option -- modified AbstractValue.cfgvalue(self, section) from cbi.lua -- needed to read from other option then current value definition |