mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-30 05:50:53 +03:00
22 lines
446 B
Bash
22 lines
446 B
Bash
#!/bin/sh
|
|
|
|
ZAPRET=/etc/init.d/zapret
|
|
|
|
[ "$ACTION" = "ifup" ] && [ -x "$ZAPRET" ] && "$ZAPRET" enabled && {
|
|
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
|
|
[ "$INTERFACE" = "$lan" ] && {
|
|
"$ZAPRET" restart
|
|
break
|
|
}
|
|
done
|
|
}
|