mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
adblock: release 1.0.0
* add sysctl.org as new adblock source * add main debug switch (by default all stderr outputs are going to /dev/null) * small cleanups * first 'stable' release! ;-) Signed-off-by: Dirk Brenken <openwrt@brenken.org>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
START=99
|
||||
|
||||
exec 2>/dev/null
|
||||
adb_pid="${$}"
|
||||
adb_script="/usr/bin/adblock-update.sh"
|
||||
adb_pidfile="/var/run/adblock.pid"
|
||||
@@ -19,7 +20,7 @@ fi
|
||||
|
||||
if [ -r "${adb_pidfile}" ]
|
||||
then
|
||||
"${adb_logger}" ${log_parm} -t "adblock[${adb_pid}] error" "adblock service already running ($(cat ${adb_pidfile} 2>/dev/null))"
|
||||
"${adb_logger}" ${log_parm} -t "adblock[${adb_pid}] error" "adblock service already running ($(cat ${adb_pidfile})" 2>&1
|
||||
exit 255
|
||||
fi
|
||||
|
||||
@@ -48,23 +49,23 @@ reload()
|
||||
|
||||
stop()
|
||||
{
|
||||
rm_done="$(find "/tmp/dnsmasq.d" -maxdepth 1 -type f -name "adb_list.*" -print -exec rm -f "{}" \; 2>/dev/null)"
|
||||
rm_done="$(find "/tmp/dnsmasq.d" -maxdepth 1 -type f -name "adb_list.*" -print -exec rm -f "{}" \;)"
|
||||
rc=${?}
|
||||
if [ $((rc)) -eq 0 ] && [ -n "${rm_done}" ]
|
||||
then
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
/etc/init.d/firewall restart >/dev/null 2>&1
|
||||
/etc/init.d/dnsmasq restart
|
||||
/etc/init.d/firewall restart
|
||||
fi
|
||||
|
||||
uhttpd_pid="$(ps 2>/dev/null | grep "[u]httpd.*\-h /www/adblock" 2>/dev/null | awk '{print $1}' 2>/dev/null)"
|
||||
uhttpd_pid="$(ps | grep "[u]httpd.*\-h /www/adblock" | awk '{print $1}')"
|
||||
if [ -n "${uhttpd_pid}" ]
|
||||
then
|
||||
kill -9 "${uhttpd_pid}" >/dev/null 2>&1
|
||||
kill -9 "${uhttpd_pid}"
|
||||
fi
|
||||
|
||||
if [ -n "${rm_done}" ] || [ -n "${uhttpd_pid}" ]
|
||||
then
|
||||
"${adb_logger}" ${log_parm} -t "adblock[${adb_pid}] info " "all adblock related services stopped"
|
||||
"${adb_logger}" ${log_parm} -t "adblock[${adb_pid}] info " "all adblock related services stopped" 2>&1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user