From a66f3e288aebaeec94a704866d4fcb369f11f5d4 Mon Sep 17 00:00:00 2001 From: CodeRoK7 <58553260+CodeRoK7@users.noreply.github.com> Date: Tue, 16 Sep 2025 12:07:34 +0000 Subject: [PATCH] Add check version OpenWRT --- universal_config_new_podkop.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/universal_config_new_podkop.sh b/universal_config_new_podkop.sh index 697007a..15c47d6 100644 --- a/universal_config_new_podkop.sh +++ b/universal_config_new_podkop.sh @@ -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