openwrt init: change hotplug script to use OPENWRT_LAN

This commit is contained in:
bol-van 2021-09-29 14:09:53 +03:00
parent 19c70ae9ea
commit 0a1c81b94d

View File

@ -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
}