summaryrefslogtreecommitdiffstats
path: root/net/adblock/files/adblock.hotplug
blob: ee48bb05c4e381a527806a2ab3e37f839f530bc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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