I am looking for a way to enable or disable a firewall rule depending on a successful or failed tool fetch.
When I run the tool fetch itself from the terminal I see the status: finished or status:failed response. Is there a way to get this data and use it as the trigger to enable or disable the desired firewall rule.
Unfortunately it is not possibel to get that status. And if fetch fails script stops executing immediatly.
So only way to check if fetch succeeded or failed is run in one script fetch and then run another script which checks if fetch fetched a file to the router. If there is a file then fetch succeeded otherwise fetch failed.
when a file downloaded status not finish myStr length return 0
but when file not downloaded or port is closed script finish and nothing return and exit script done
please help how I can receive open port message without download a page
not possible to store result or downloaded file into variable. Maybe future RouterOS versions will have that capability, but currently it is not possible and there is no time-frame when it could become available.