init.d: openwrt hotplug script use link target of /etc/init.d/zapret

This commit is contained in:
bol-van 2021-12-28 11:59:50 +03:00
parent ef18b85b42
commit 98f43819f6

View File

@ -3,7 +3,13 @@
ZAPRET=/etc/init.d/zapret
[ "$ACTION" = "ifup" ] && [ -x "$ZAPRET" ] && "$ZAPRET" enabled && {
[ -n "$ZAPRET_BASE" ] || ZAPRET_BASE=/opt/zapret
SCRIPT=$(readlink "$ZAPRET")
if [ -n "$SCRIPT" ]; then
EXEDIR=$(dirname "$SCRIPT")
ZAPRET_BASE=$(readlink -f "$EXEDIR/../..")
else
ZAPRET_BASE=/opt/zapret
fi
. "$ZAPRET_BASE/config"
[ -n "$OPENWRT_LAN" ] || OPENWRT_LAN=lan
for lan in $OPENWRT_LAN; do