Skip to content

Commit

Permalink
adblock-fast: prepare migration to APK
Browse files Browse the repository at this point in the history
Signed-off-by: Stan Grishin <stangri@melmac.ca>
  • Loading branch information
stangri committed Mar 23, 2024
1 parent 6c3db5d commit 706592e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion net/adblock-fast/Makefile
Expand Up @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=adblock-fast
PKG_VERSION:=1.1.1
PKG_RELEASE:=5
PKG_RELEASE:=r7
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_LICENSE:=GPL-3.0-or-later

Expand Down
15 changes: 7 additions & 8 deletions net/adblock-fast/files/etc/init.d/adblock-fast
Expand Up @@ -56,6 +56,7 @@ readonly unboundFilter='s|^|local-zone: "|;s|$|" static|'
readonly A_TMP="/var/${packageName}.a.tmp"
readonly B_TMP="/var/${packageName}.b.tmp"
readonly SED_TMP="/var/${packageName}.sed.tmp"
readonly uciConfigFile="/etc/config/${packageName}"
readonly runningConfigFile="/dev/shm/${packageName}.config"
readonly runningErrorFile="/dev/shm/${packageName}.error"
readonly runningStatusFile="/dev/shm/${packageName}.status"
Expand Down Expand Up @@ -128,7 +129,7 @@ config_cache() {
local i ret
case "$param" in
create|set)
cp -f "/etc/config/${packageName}" "$runningConfigFile"
cp -f "$uciConfigFile" "$runningConfigFile"
;;
get)
case "$var" in
Expand All @@ -145,6 +146,8 @@ config_cache() {
local old_allowed_url old_blocked_url
if [ ! -s "$runningConfigFile" ]; then
ret='on_boot'
elif cmp -s "$uciConfigFile" "$runningConfigFile"; then
ret='restart'
else
for i in $_reload; do
local val_current val_old UCI_CONFIG_DIR
Expand Down Expand Up @@ -199,7 +202,7 @@ config_cache() {
;;
esac
}
debug() { local i j; for i in "$@"; do eval "j=\$$i"; echo "${i}: ${j} "; done; }
debug() { local __i __j; for __i in "$@"; do eval "__j=\$$__i"; echo "${__i}: ${__j} "; done; }
dns_set_output_values() {
case "$1" in
dnsmasq.addnhosts)
Expand Down Expand Up @@ -315,7 +318,6 @@ is_running() {
fi
}
ipset() { "$ipset" "$@" >/dev/null 2>&1; }
get_version() { grep -m1 -A2 -w "^Package: $1$" /usr/lib/opkg/status | sed -n 's/Version: //p'; }
get_ram_free() { ubus call system info | jsonfilter -e '@.memory.free'; }
get_ram_total() { ubus call system info | jsonfilter -e '@.memory.total'; }
led_on(){ if [ -n "${1}" ] && [ -e "${1}/trigger" ]; then echo 'default-on' > "${1}/trigger" 2>&1; fi; }
Expand Down Expand Up @@ -807,11 +809,8 @@ load_environment() {
dl_flag="-O"
fi
led="${led:+/sys/class/leds/$led}"
if curl --version 2>/dev/null | grep -q "https" \
|| wget --version 2>/dev/null | grep -q "+https" \
|| grep -q "libustream-mbedtls" /usr/lib/opkg/status \
|| grep -q "libustream-openssl" /usr/lib/opkg/status \
|| grep -q "libustream-wolfssl" /usr/lib/opkg/status; then
if curl --version 2>/dev/null | grep -q "Protocols: .*https.*" \
|| wget --version 2>/dev/null | grep -q "+ssl"; then
isSSLSupported=1
else
unset isSSLSupported
Expand Down

0 comments on commit 706592e

Please sign in to comment.