summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.ca>2023-11-24 00:13:24 -0700
committerGitHub <noreply@github.com>2023-11-24 00:13:24 -0700
commit6daf8f25ec3f4182e4fd4bfdb4223052e7134c11 (patch)
tree09696b8a11c8b259ac34e541b5c8abfc814ef4f9
parent593f5c2afc5b55adab92097c85332b37771d8d96 (diff)
parent97fd6c23fd9605284727d88c641d4b983a0b2b1a (diff)
Merge pull request #22738 from stangri/openwrt-22.03-https-dns-proxy
[22.03] https-dns-proxy: bugfix: prevent erros from boot()
-rw-r--r--net/https-dns-proxy/Makefile3
-rwxr-xr-xnet/https-dns-proxy/files/etc/init.d/https-dns-proxy16
-rw-r--r--net/https-dns-proxy/patches/020-src-options.c-add-version.patch2
3 files changed, 10 insertions, 11 deletions
diff --git a/net/https-dns-proxy/Makefile b/net/https-dns-proxy/Makefile
index e66f8e5bd..3037bd5a2 100644
--- a/net/https-dns-proxy/Makefile
+++ b/net/https-dns-proxy/Makefile
@@ -2,13 +2,14 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=https-dns-proxy
PKG_VERSION:=2023-10-25
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
PKG_SOURCE_DATE:=$(PKG_VERSION)
PKG_SOURCE_VERSION:=977341a4e35a37ee454e97e82caf4276b1b4961a
PKG_MIRROR_HASH:=8622846f1038ac05436a48d9b36a07c516cbb6504ce68e7ee8c5529788fac39b
+
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
diff --git a/net/https-dns-proxy/files/etc/init.d/https-dns-proxy b/net/https-dns-proxy/files/etc/init.d/https-dns-proxy
index 5679f6349..672e837c7 100755
--- a/net/https-dns-proxy/files/etc/init.d/https-dns-proxy
+++ b/net/https-dns-proxy/files/etc/init.d/https-dns-proxy
@@ -30,10 +30,11 @@ readonly canaryDomainsiCloud='mask.icloud.com mask-h2.icloud.com'
on_boot_trigger=
-str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; }
+dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; }
is_mac_address() { expr "$1" : '[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]$' >/dev/null; }
is_ipv4() { expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; }
is_ipv6() { ! is_mac_address "$1" && str_contains "$1" ":"; }
+is_resolver_working() { resolveip -t 3 one.one.one.one >/dev/null 2>&1; }
output() {
local msg memmsg logmsg
local sharedMemoryOutput="/dev/shm/$packageName-output"
@@ -52,6 +53,7 @@ output_ok() { output "$_OK_"; }
output_okn() { output "${_OK_}\\n"; }
output_fail() { output "$_FAIL_"; }
output_failn() { output "${_FAIL_}\\n"; }
+str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; }
uci_add_list_if_new() {
local PACKAGE="$1"
local CONFIG="$2"
@@ -70,9 +72,6 @@ uci_changes() {
local OPTION="$3"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} changes "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
}
-
-dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; }
-
version() { echo "$PKG_VERSION"; }
xappend() { PROG_param="$PROG_param $1"; }
@@ -131,13 +130,11 @@ append_bootstrap() {
[ "$ipv6_resolvers_only" -eq 0 ] && xappend '-4'
}
-resolver_health_check() { resolveip -t 3 one.one.one.one >/dev/null 2>&1; }
-
boot() {
ubus -t 30 wait_for network.interface 2>/dev/null
on_boot_trigger=1
- rc_procd start_service 'on_boot' && rc_procd service_started 'on_boot'
- resolver_health_check || rc_procd stop_service 'on_boot'
+ rc_procd start_service 'on_boot' && service_started 'on_boot'
+ is_resolver_working || rc_procd stop_service 'on_boot' && service_stopped 'on_boot'
}
start_instance() {
@@ -203,7 +200,8 @@ start_instance() {
procd_close_data
procd_close_instance
- if [ "$?" ]; then
+# shellcheck disable=SC2181
+ if [ "$?" -eq 0 ]; then
config_get listen_addr "$cfg" 'listen_addr' '127.0.0.1'
config_get listen_port "$cfg" 'listen_port' "$port"
if [ "$dnsmasq_config_update" = '*' ]; then
diff --git a/net/https-dns-proxy/patches/020-src-options.c-add-version.patch b/net/https-dns-proxy/patches/020-src-options.c-add-version.patch
index d34621793..72d3dc5df 100644
--- a/net/https-dns-proxy/patches/020-src-options.c-add-version.patch
+++ b/net/https-dns-proxy/patches/020-src-options.c-add-version.patch
@@ -5,7 +5,7 @@
return SW_VERSION;
#else
- return "2023.10.10-atLeast"; // update date sometimes, like 1-2 times a year
-+ return "2023-10-25-1"; // update date sometimes, like 1-2 times a year
++ return "2023-10-25-3"; // update date sometimes, like 1-2 times a year
#endif
}