From 98f43819f6ca592da9f24210a8aad28606674cda Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 28 Dec 2021 11:59:50 +0300 Subject: [PATCH] init.d: openwrt hotplug script use link target of /etc/init.d/zapret --- init.d/openwrt/90-zapret | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.d/openwrt/90-zapret b/init.d/openwrt/90-zapret index 10554fb..381f9f1 100644 --- a/init.d/openwrt/90-zapret +++ b/init.d/openwrt/90-zapret @@ -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