RouterOS get uptime days code is:
Code: Select all
put "Uptime: $[:if ([:len [:find [/system resource get uptime] "w"]] != 0) do={([:pick [/system resource get uptime] 0 ([:find [/system resource get uptime] "w"])] *7 + [:pick [/system resource get uptime] ([:find [/system resource get
uptime] "d"] -1) ([:find [/system resource get uptime] "d"])])} else={[:pick [/system resource get uptime] ([:find [/system resource get uptime] "d"]-1) ([:find [/system resource get uptime] "d"])]}] days"
The output result is:
Uptime: days;Uptime: 18 days
I have a problem.
The output has more "Uptime: days;"
I don't want the output to have the "Uptime: days;" symbol.
Or is there a better way for people to do this?