---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
+-- Copyright 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+-- Licensed to the public under the Apache License 2.0.
local CTRL = require "luci.controller.ddns" -- this application's controller
local DISP = require "luci.dispatcher"
-- check supported options -- ##################################################
-- saved to local vars here because doing multiple os calls slow down the system
-has_ssl = DDNS.check_ssl() -- HTTPS support
+has_ssl = DDNS.check_ssl() -- HTTPS support and --bind-network / --interface
has_proxy = DDNS.check_proxy() -- Proxy support
has_dnstcp = DDNS.check_bind_host() -- DNS TCP support
-need_update = CTRL.update_needed() -- correct ddns-scripts version
+-- correct ddns-scripts version
+need_update = DDNS.ipkg_ver_compare(DDNS.ipkg_ver_installed("ddns-scripts"), "<<", CTRL.DDNS_MIN)
-- html constants
font_red = [[<font color="red">]]
translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.")
end
+-- No bind_network
+if not has_ssl then
+ local dv = s:option(DummyValue, "_no_bind_network")
+ dv.titleref = DISP.build_url("admin", "system", "packages")
+ dv.rawhtml = true
+ dv.title = bold_on ..
+ translate("Binding to a specific network not supported") .. bold_off
+ dv.value = translate("Neither GNU Wget with SSL nor cURL installed to select a network to use for communication.") ..
+ "<br />- " ..
+ translate("You should install GNU Wget with SSL or cURL package.") ..
+ "<br />- " ..
+ translate("GNU Wget will use the IP of given network, cURL will use the physical interface.") ..
+ "<br />- " ..
+ translate("In some versions cURL/libcurl in OpenWrt is compiled without proxy support.")
+end
+
-- cURL without proxy support
if has_ssl and not has_proxy then
local dv = s:option(DummyValue, "_no_proxy")