Skip to content

Commit

Permalink
Merge Official Source
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
  • Loading branch information
1715173329 committed Dec 2, 2024
2 parents f5d1748 + b5f11b7 commit 89eb37f
Show file tree
Hide file tree
Showing 4 changed files with 731 additions and 11 deletions.
2 changes: 1 addition & 1 deletion net/adblock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=adblock
PKG_VERSION:=4.2.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>

Expand Down
17 changes: 7 additions & 10 deletions net/adblock/files/adblock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ f_dns() {
if [ -z "${adb_dns}" ]; then
utils="knot-resolver bind-server unbound-daemon dnsmasq-full dnsmasq-dhcpv6 dnsmasq"
for util in ${utils}; do
if printf "%s" "${adb_packages}" | "${adb_jsoncmd}" -ql1 -e "@.packages.${util}" >/dev/null 2>&1; then
if printf "%s" "${adb_packages}" | "${adb_jsoncmd}" -ql1 -e "@.packages[\"${util}\"]" >/dev/null 2>&1; then
case "${util}" in
"knot-resolver")
util="kresd"
Expand Down Expand Up @@ -361,10 +361,11 @@ f_dns() {
f_fetch() {
local util utils insecure

if [ -z "${adb_fetchutil}" ]; then
adb_fetchutil="$(command -v "${adb_fetchutil}")"
if [ ! -x "${adb_fetchutil}" ]; then
utils="aria2 curl wget-ssl libustream-openssl libustream-wolfssl libustream-mbedtls"
for util in ${utils}; do
if printf "%s" "${adb_packages}" | "${adb_jsoncmd}" -ql1 -e "@.packages.${util}" >/dev/null 2>&1; then
if printf "%s" "${adb_packages}" | "${adb_jsoncmd}" -ql1 -e "@.packages[\"${util}\"]" >/dev/null 2>&1; then
case "${util}" in
"aria2")
util="aria2c"
Expand All @@ -378,7 +379,7 @@ f_fetch() {
esac

if [ -x "$(command -v "${util}")" ]; then
adb_fetchutil="${util}"
adb_fetchutil="$(command -v "${util}")"
uci_set adblock global adb_fetchutil "${util}"
f_uci "adblock"
break
Expand All @@ -387,11 +388,9 @@ f_fetch() {
done
fi

if [ ! -x "$(command -v "${adb_fetchutil}")" ]; then
f_log "err" "download utility with SSL support not found, please set 'adb_fetchutil' manually"
fi
[ ! -x "${adb_fetchutil}" ] && f_log "err" "download utility with SSL support not found, please set 'adb_fetchutil' manually"

case "${adb_fetchutil}" in
case "${adb_fetchutil##*/}" in
"aria2c")
[ "${adb_fetchinsecure}" = "1" ] && insecure="--check-certificate=false"
adb_fetchparm="${adb_fetchparm:-"${insecure} --timeout=20 --allow-overwrite=true --auto-file-renaming=false --log-level=warn --dir=/ -o"}"
Expand All @@ -410,8 +409,6 @@ f_fetch() {
;;
esac

adb_fetchutil="$(command -v "${adb_fetchutil}")"

f_log "debug" "f_fetch ::: fetch_util: ${adb_fetchutil:-"-"}, fetch_parm: ${adb_fetchparm:-"-"}"
}

Expand Down
Loading

0 comments on commit 89eb37f

Please sign in to comment.