Amm0
January 24, 2025, 6:36pm
68
if username, password, etc. are defined in the script, put them right inside the function..............
For that, there is the $SECRET function that stashes them at least persists a password sensitive attribute. It far from ideal, but better than putting them directly in a script IMO:
In V7, I’ve been trying to “port” some bash/javascript scripts we use. Most just call various REST APIs. Been using RouterOS script using /tool/fetch to replicate some of them, since running them directly on a router make scripting SOME stuff easier.
Problem is some REST API I call need an “apikey” or “token”, which is essentially a fancy password needed for the API.
e.g.
:global apikey [???????]
/tool/fetch url=... http-header-field="Authorization: bearer $apikey" ...
Since I’m just exper…