mirror of
https://github.com/gSpotx2f/ruantiblock_openwrt.git
synced 2026-05-14 22:50:58 +00:00
v1.4. ruab_route_check
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
IF_VPN=`uci get ruantiblock.config.if_vpn`
|
||||
PROXY_MODE=`uci get ruantiblock.config.proxy_mode`
|
||||
UCI_CMD=`which uci`
|
||||
if [ $? -ne 0 ]; then
|
||||
echo " Error! UCI doesn't exists" >&2
|
||||
exit 1
|
||||
fi
|
||||
RUAB_CMD="/usr/bin/ruantiblock"
|
||||
PROXY_MODE=`$UCI_CMD get ruantiblock.config.proxy_mode`
|
||||
IF_VPN=`$UCI_CMD get ruantiblock.config.if_vpn`
|
||||
VPN_ROUTE_CHECK=`$UCI_CMD get ruantiblock.config.vpn_route_check`
|
||||
|
||||
[ "$VPN_ROUTE_CHECK" != "0" ] && exit 0
|
||||
|
||||
if [ "$ACTION" = "ifup" ] && [ "$PROXY_MODE" = "2" ] && [ "$DEVICE" = "$IF_VPN" ]; then
|
||||
if [ `/usr/bin/ruantiblock raw-status` -ne 2 ]; then
|
||||
if [ `$RUAB_CMD raw-status` -ne 2 ]; then
|
||||
sleep 5
|
||||
/usr/bin/ruantiblock reload
|
||||
$RUAB_CMD reload
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user