packages/net/adblock/files/adblock.hotplug
Dirk Brenken 23b14e7b4c adblock: update 1.4.10
- add 'enabled' check to iface hotplug event handler
- decrease startup priority from 99 to 90
- fix tab indentation in config

Signed-off-by: Dirk Brenken <dev@brenken.org>
2016-09-29 18:07:45 +02:00

24 lines
594 B
Bash

#!/bin/sh
#
adb_pid="${$}"
adb_helper="/usr/bin/adblock-helper.sh"
adb_pidfile="/var/run/adblock.pid"
adb_enabled="$(/etc/init.d/adblock enabled; echo $?)"
if [ "${adb_enabled}" = "1" ] || [ -f "${adb_pidfile}" ] || [ "${ACTION}" != "ifup" ]
then
exit 0
fi
. "${adb_helper}"
f_envload
if [ "${INTERFACE}" = "${adb_wanif4}" ] || [ "${INTERFACE}" = "${adb_wanif6}" ]
then
if [ -z "${adb_hotplugif}" ] || [ "${INTERFACE}" = "${adb_hotplugif}" ]
then
/etc/init.d/adblock start
f_log "adblock service started due to '${ACTION}' of '${INTERFACE}' interface"
fi
fi