diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-02-28 13:25:57 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-02-28 13:25:57 +0100 |
commit | f47be40cd4e326699a3706aec20f89f1549e1439 (patch) | |
tree | fe0b4baf66a661f83b7ef6aa57a66d4a21beccc5 /applications/luci-app-ddns/luasrc/tools/ddns.lua | |
parent | 293d964ae2ca9c046cacbd0f2953c7b4f992a169 (diff) | |
parent | 8b0f83264a5d33078eaca1f15de226cc7f984f59 (diff) |
Merge pull request #325 from chris5560/master-app-ddns
luci-app-ddns: update to version 2.2.0-1
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 2fbcff8bad..e9c3fa936a 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 |