mirror of
https://github.com/gSpotx2f/ruantiblock_openwrt.git
synced 2026-05-14 06:30:59 +00:00
Fixed update at startup
This commit is contained in:
@@ -17,7 +17,7 @@ define Package/$(PKG_NAME)
|
|||||||
TITLE:=Ruantiblock
|
TITLE:=Ruantiblock
|
||||||
URL:=https://github.com/gSpotx2f/ruantiblock_openwrt
|
URL:=https://github.com/gSpotx2f/ruantiblock_openwrt
|
||||||
PKGARCH:=all
|
PKGARCH:=all
|
||||||
DEPENDS:=+wget +dnsmasq-full
|
DEPENDS:=+dnsmasq-full
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/description
|
define Package/$(PKG_NAME)/description
|
||||||
|
|||||||
@@ -302,16 +302,19 @@ AddNftSets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateBllistSets() {
|
UpdateBllistSets() {
|
||||||
|
local _return_code=0
|
||||||
if [ -f "$IP_DATA_FILE" ]; then
|
if [ -f "$IP_DATA_FILE" ]; then
|
||||||
echo " Updating nft sets..."
|
echo " Updating nft sets..."
|
||||||
$NFT_CMD -f "$IP_DATA_FILE"
|
$NFT_CMD -f "$IP_DATA_FILE"
|
||||||
if [ $? -eq 0 ]; then
|
_return_code=$?
|
||||||
|
if [ $_return_code -eq 0 ]; then
|
||||||
echo " Ok"
|
echo " Ok"
|
||||||
else
|
else
|
||||||
echo " Error! Nft set wasn't updated" >&2
|
echo " Error! Nft set wasn't updated" >&2
|
||||||
MakeLogRecord "err" "Error! Nft set wasn't updated"
|
MakeLogRecord "err" "Error! Nft set wasn't updated"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
return $_return_code
|
||||||
}
|
}
|
||||||
|
|
||||||
AddNftRules() {
|
AddNftRules() {
|
||||||
@@ -525,6 +528,7 @@ Update() {
|
|||||||
FlushNftSets "$NFTSET_CIDR_USER" "$NFTSET_IP_USER"
|
FlushNftSets "$NFTSET_CIDR_USER" "$NFTSET_IP_USER"
|
||||||
fi
|
fi
|
||||||
UpdateBllistSets
|
UpdateBllistSets
|
||||||
|
_return_code=$?
|
||||||
DnsmasqRestart
|
DnsmasqRestart
|
||||||
ToggleUPIDFile del
|
ToggleUPIDFile del
|
||||||
fi
|
fi
|
||||||
@@ -551,6 +555,7 @@ Start() {
|
|||||||
SetNetConfig
|
SetNetConfig
|
||||||
PreStartCheck
|
PreStartCheck
|
||||||
UpdateBllistSets
|
UpdateBllistSets
|
||||||
|
_return_code=$?
|
||||||
### Start-script
|
### Start-script
|
||||||
[ -x "$START_SCRIPT" ] && $START_SCRIPT > /dev/null 2>&1 &
|
[ -x "$START_SCRIPT" ] && $START_SCRIPT > /dev/null 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user