From 0a1c81b94d0a5734d6920663fe72deb6267627cb Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 29 Sep 2021 14:09:53 +0300 Subject: [PATCH] openwrt init: change hotplug script to use OPENWRT_LAN --- init.d/openwrt/90-zapret | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/init.d/openwrt/90-zapret b/init.d/openwrt/90-zapret index a2d6324..94a7568 100644 --- a/init.d/openwrt/90-zapret +++ b/init.d/openwrt/90-zapret @@ -1,8 +1,14 @@ #!/bin/sh ZAPRET=/etc/init.d/zapret -[ -x "$ZAPRET" ] && [ "$INTERFACE" = "lan" ] && { - [ "$ACTION" = "ifup" ] && { - $ZAPRET enabled && $ZAPRET restart - } + +[ "$ACTION" = "ifup" ] && [ -x "$ZAPRET" ] && "$ZAPRET" enabled && { + [ -n "$ZAPRET_BASE" ] || ZAPRET_BASE=/opt/zapret + . "$ZAPRET_BASE/config" + for lan in $OPENWRT_LAN; do + [ "$INTERFACE" = "$lan" ] && { + "$ZAPRET" restart + break + } + done }