I am attempting to write a ROS script where based on the system uptime I need to turn up (disable=no) an interface. The only thing that seems to be eluding me is actually getting the uptime value into a variable I can work with in the script. Is there a specific “get” that I can get just the uptime? So far I have not stumbled on the correct syntax for that, and the manual has not been too helpful.
If there is no elegant and simple solution, then plan B would be to parse the output of “/ system resource print” to get the information.
Thanks for the reply, I am certain I tried “/system resource get uptime” before I posted but I must have had some error in the syntax or it was one of those things where the error was so obvious I could not see it. Anyhow it works now, and here is what I came up with.
Delay needed to get everything up and running after boot, otherwise script starts too quickly, and fails for some unknown reason.
Nothing, but it is in association with a netwatch, on a wireless link. If the router was just re-booted I want to wait an hour before I do some housekeeping, and if the link just flaps then I’m doing other stuff.
Yes, I suppose I could have done as you describe, and then have some netwatch items that get disabled and others enabled and hour after a re-boot but when the netwatch item is enabled it tests the condition and it executes the event based on the up/down condition. So I still needed to test to see if the change in state up/down was due to a reboot, or just network condition.. I guess in the end this was my approach to fulfill the request, Boss is happy.. Happy Boss = life is good.