2021-03-04 11:30:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
ZAPRET=/etc/init.d/zapret
|
2021-09-29 11:09:53 +00:00
|
|
|
|
|
|
|
[ "$ACTION" = "ifup" ] && [ -x "$ZAPRET" ] && "$ZAPRET" enabled && {
|
2021-12-28 08:59:50 +00:00
|
|
|
SCRIPT=$(readlink "$ZAPRET")
|
|
|
|
if [ -n "$SCRIPT" ]; then
|
|
|
|
EXEDIR=$(dirname "$SCRIPT")
|
|
|
|
ZAPRET_BASE=$(readlink -f "$EXEDIR/../..")
|
|
|
|
else
|
|
|
|
ZAPRET_BASE=/opt/zapret
|
|
|
|
fi
|
2021-09-29 11:09:53 +00:00
|
|
|
. "$ZAPRET_BASE/config"
|
2021-09-29 11:18:36 +00:00
|
|
|
[ -n "$OPENWRT_LAN" ] || OPENWRT_LAN=lan
|
2021-09-29 11:09:53 +00:00
|
|
|
for lan in $OPENWRT_LAN; do
|
|
|
|
[ "$INTERFACE" = "$lan" ] && {
|
|
|
|
"$ZAPRET" restart
|
|
|
|
break
|
|
|
|
}
|
|
|
|
done
|
2021-03-04 11:30:38 +00:00
|
|
|
}
|