Community discussions

MikroTik App
 
lijo
just joined
Topic Author
Posts: 3
Joined: Mon Apr 15, 2024 10:27 am

CHR routerboard command not availble anymore

Mon Apr 15, 2024 10:36 am

The company I work for uses alot of scripts across both CHRs and routerboards. To validate if the script is currently running on a CHR or a routerboard we have always used the "/system routerboard get routerboard" command.
It seems like that this has been removed in CHRs on ROS7. In ROS6 it would always generate false/true based on if it was a CHR or a routerboard.

Does anyone know if this will be brought back in ROS7 or if there is a better way to accomplish it?
I have not been able to find any information why this was removed from ROS7 CHRs.

If you want to test it on your own device you can run:
:local test [/system routerboard get routerboard]; :put $test
 
User avatar
baragoon
Member
Member
Posts: 365
Joined: Thu Jan 05, 2017 10:38 am
Location: Kyiv, UA
Contact:

Re: CHR routerboard command not availble anymore  [SOLVED]

Mon Apr 15, 2024 4:58 pm

/system/resource get board-name
 
lijo
just joined
Topic Author
Posts: 3
Joined: Mon Apr 15, 2024 10:27 am

Re: CHR routerboard command not availble anymore

Mon Apr 15, 2024 10:08 pm

/system/resource get board-name
Works good enough, thank you!
Sad that the menu was removed, even though it was completely empty. It was nice to have a simple bool to check.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12445
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: CHR routerboard command not availble anymore

Mon Apr 15, 2024 10:11 pm

No logic on check what do not exist.

true when is a routerboard
:put ([/system resource get board-name] != "CHR")
 
alebu
just joined
Posts: 3
Joined: Wed Jan 10, 2018 9:58 am

Re: CHR routerboard command not availble anymore

Mon Jun 10, 2024 5:51 pm

No logic on check what do not exist.

true when is a routerboard
:put ([/system resource get board-name] != "CHR")
From RouterOS 7.15 system resource get board-name includes also the virtualization platform like "CHR VMware, Inc. VMware Virtual Platform", so I've update the check in this way.

true when is a routerboard
:put ("ABC" . [:find [/system resource get board-name] "CHR"] . "DEF"="ABCDEF")
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12445
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: CHR routerboard command not availble anymore

Tue Jun 11, 2024 9:45 am

No logic on check what do not exist.

true when is a routerboard
:put ([/system resource get board-name] != "CHR")
From RouterOS 7.15 system resource get board-name includes also the virtualization platform like "CHR VMware, Inc. VMware Virtual Platform", so I've update the check in this way.

true when is a routerboard
:put ("ABC" . [:find [/system resource get board-name] "CHR"] . "DEF"="ABCDEF")

No logic to add something instead of just check...

true when is a routerboard
:put ([/system resource get board-name] ~ "CHR")

(on my case is "CHR VMware, Inc. VMware Virtual Platform")

Who is online

Users browsing this forum: No registered users and 7 guests