From d67de77558b5e492e6593633c0e70c43c47ab7cc Mon Sep 17 00:00:00 2001 From: Pothi Kalimuthu <1254302+pothi@users.noreply.github.com> Date: Thu, 5 Jun 2025 10:10:49 +0530 Subject: [PATCH] Add a test script to test Router OS version --- test-snippets/test-version-7.19.rsc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test-snippets/test-version-7.19.rsc diff --git a/test-snippets/test-version-7.19.rsc b/test-snippets/test-version-7.19.rsc new file mode 100644 index 0000000..6b63538 --- /dev/null +++ b/test-snippets/test-version-7.19.rsc @@ -0,0 +1,17 @@ +# find RouterOS version + +:local rosVersion +:set rosVersion [:pick [/system/routerboard/get current-firmware] 0 1] + +:if ($rosVersion != 7) do={ + :error "We need Router OS version 7 to run this script - current ROS version $rosVersion." +} + +:local rosVersionMinor +:set rosVersionMinor [:pick [/system/routerboard/get current-firmware] 2 4] + +:if ($rosVersionMinor >= 19) do={ + :put "We have the required Router OS version (or greater) - $rosVersion.$rosVersionMinor" +} else={ + :put "We use the Router OS version $rosVersion.$rosVersionMinor that is less than the required version (7.19)." +}