From 4bb8a34bbfba182526f335fe56a6d13befda801c Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sun, 3 Jul 2016 07:42:19 +0200 Subject: [PATCH] adblock: update 1.3.2 * only a few more fixes Signed-off-by: Dirk Brenken Euro 16: germany vs. italy 6:5 (after 18 penalties) :-) --- net/adblock/Makefile | 2 +- net/adblock/files/adblock-helper.sh | 60 ++++++++++++++--------------- net/adblock/files/adblock-update.sh | 2 +- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/net/adblock/Makefile b/net/adblock/Makefile index dd4e69a17..78f16acc3 100644 --- a/net/adblock/Makefile +++ b/net/adblock/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock -PKG_VERSION:=1.3.1 +PKG_VERSION:=1.3.2 PKG_RELEASE:=1 PKG_LICENSE:=GPL-3.0+ PKG_MAINTAINER:=Dirk Brenken diff --git a/net/adblock/files/adblock-helper.sh b/net/adblock/files/adblock-helper.sh index ca8dafe11..4aa6b2be3 100644 --- a/net/adblock/files/adblock-helper.sh +++ b/net/adblock/files/adblock-helper.sh @@ -422,25 +422,21 @@ f_envcheck() # check volatile uhttpd instance configuration # - check="$(pgrep -f "uhttpd -h /www/adblock")" - if [ -z "${check}" ] + if [ -n "${adb_wanif4}" ] && [ -n "${adb_wanif6}" ] then - if [ -n "${adb_wanif4}" ] && [ -n "${adb_wanif6}" ] - then - f_uhttpd "adbIPv4+6_80" "1" "-p ${adb_ipv4}:${adb_nullport} -p [${adb_ipv6}]:${adb_nullport}" - f_uhttpd "adbIPv4+6_443" "0" "-p ${adb_ipv4}:${adb_nullportssl} -p [${adb_ipv6}]:${adb_nullportssl}" - elif [ -n "${adb_wanif4}" ] - then - f_uhttpd "adbIPv4_80" "1" "-p ${adb_ipv4}:${adb_nullport}" - f_uhttpd "adbIPv4_443" "0" "-p ${adb_ipv4}:${adb_nullportssl}" - else - f_uhttpd "adbIPv6_80" "1" "-p [${adb_ipv6}]:${adb_nullport}" - f_uhttpd "adbIPv6_443" "0" "-p [${adb_ipv6}]:${adb_nullportssl}" - fi - if [ "${uhttpd_ok}" = "true" ] - then - f_log "created volatile uhttpd instances" - fi + f_uhttpd "adbIPv4+6_80" "1" "-p ${adb_ipv4}:${adb_nullport} -p [${adb_ipv6}]:${adb_nullport}" + f_uhttpd "adbIPv4+6_443" "0" "-p ${adb_ipv4}:${adb_nullportssl} -p [${adb_ipv6}]:${adb_nullportssl}" + elif [ -n "${adb_wanif4}" ] + then + f_uhttpd "adbIPv4_80" "1" "-p ${adb_ipv4}:${adb_nullport}" + f_uhttpd "adbIPv4_443" "0" "-p ${adb_ipv4}:${adb_nullportssl}" + else + f_uhttpd "adbIPv6_80" "1" "-p [${adb_ipv6}]:${adb_nullport}" + f_uhttpd "adbIPv6_443" "0" "-p [${adb_ipv6}]:${adb_nullportssl}" + fi + if [ "${uhttpd_ok}" = "true" ] + then + f_log "created volatile uhttpd instances" fi # check whitelist entries @@ -471,7 +467,6 @@ f_depend() elif [ -z "${check}" ] then rc=-1 - package_ok="false" f_log "package '${package}' not found" f_exit fi @@ -490,7 +485,6 @@ f_firewall() local chpos="${5}" local notes="adb-${6}" local rules="${7}" - firewall_ok="true" # select appropriate iptables executable for IPv6 # @@ -528,9 +522,10 @@ f_firewall() then "${ipt}" -w -t "${table}" -I "${chain}" "${chpos}" -m comment --comment "${notes}" ${rules} rc=${?} - if [ $((rc)) -ne 0 ] + if [ $((rc)) -eq 0 ] then - firewall_ok="false" + firewall_ok="true" + else f_log "failed to initialize volatile ${proto} firewall rule '${notes}'" f_exit fi @@ -541,18 +536,23 @@ f_firewall() # f_uhttpd() { + local check local realm="${1}" local timeout="${2}" local ports="${3}" - uhttpd_ok="true" - uhttpd -h "/www/adblock" -N 25 -T "${timeout}" -r "${realm}" -k 0 -t 0 -R -D -S -E "/index.html" ${ports} - rc=${?} - if [ $((rc)) -ne 0 ] + check="$(pgrep -f "uhttpd -h /www/adblock -N 25 -T ${timeout} -r ${realm}")" + if [ -z "${check}" ] then - uhttpd_ok="false" - f_log "failed to initialize volatile uhttpd instance (${realm})" - f_exit + uhttpd -h "/www/adblock" -N 25 -T "${timeout}" -r "${realm}" -k 0 -t 0 -R -D -S -E "/index.html" ${ports} + rc=${?} + if [ $((rc)) -eq 0 ] + then + uhttpd_ok="true" + else + f_log "failed to initialize volatile uhttpd instance (${realm})" + f_exit + fi fi } @@ -570,8 +570,6 @@ f_space() then space_ok="false" fi - else - space_ok="false" fi } diff --git a/net/adblock/files/adblock-update.sh b/net/adblock/files/adblock-update.sh index f401301d6..caf87afbb 100755 --- a/net/adblock/files/adblock-update.sh +++ b/net/adblock/files/adblock-update.sh @@ -10,7 +10,7 @@ # adb_pid="${$}" adb_pidfile="/var/run/adblock.pid" -adb_scriptver="1.3.1" +adb_scriptver="1.3.2" adb_mincfgver="2.2" adb_scriptdir="${0%/*}" if [ -r "${adb_pidfile}" ]