So I’m trying to debug a .auto.rsc script. If I scp it over to the router and then run the script with /import it works correctly. If I ftp put the script, it auto runs about half way through, and the log file generated only says ‘this script has run successfully’. How am I supposed to debug a script that is failing if there are no logs of failure? RouterOS v6.39.2
Add your own log output to the script.
:log “adding IP address”
/ip address
add …
:log “adding IP DHCP-Client”
/ip dhcp dhcp-client
add …
And so on.
Does the script run as the ftp user that uploaded it? If so does the ftp user have the needed permissions to execute all aspects of the script?
Thanks for the suggestions.
Script appears to be running as admin based on logs. The :log trick is handy but doesn’t seem to be giving me much more information than I can already infer based on what changes and what doesn’t before/after script run. I notice in the wiki there is this:
:do {
:put [:resolve www.example.com];
} on-error={ :put "resolver failed"};
:put "lala"
Any way to capture the error and log that rather than just a string?