Fixed update at startup

This commit is contained in:
gSpot
2023-02-09 20:53:20 +03:00
parent 2c03c704a6
commit 50d8fa812a
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -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
+6 -1
View File
@@ -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