Add check version OpenWRT

This commit is contained in:
CodeRoK7
2025-09-16 12:07:34 +00:00
parent 026b319c05
commit a66f3e288a

View File

@@ -475,6 +475,22 @@ else
is_reconfig_podkop="n"
fi
#####after test delete
DESCRIPTION=$(ubus call system board | jsonfilter -e '@.release.description')
VERSION=$(ubus call system board | jsonfilter -e '@.release.version')
findKey="RouteRich"
findVersion="24.10.2"
if echo "$DESCRIPTION" | grep -qi -- "$findKey" && printf '%s\n%s\n' "$findVersion" "$VERSION" | sort -V | tail -n1 | grep -qx -- "$VERSION"; then
printf "\033[32;1mThis new firmware. Running scprit...\033[0m\n"
else
printf "\033[32;1mThis old firmware.\nTo use this script, update your firmware to the latest version....\033[0m\n"
exit 1
fi
####after test delete
echo "Update list packages..."
opkg update