routeros 6.42.5 and 6.42.6 script /file not working as expected.
the device is RB450Gx4
This code:
:local ddnshost "google.com"
:log info "Hostname = $ddnshost"
:local ddnsip [:resolve $ddnshost]
:log info "IP = $ddnsip"
/tool fetch mode=https address=[:resolve ifconfig.co] port=443 host="ifconfig.co" \
src-path="/ip" dst-path="/currentip.txt"
:log info "got here"
:local currentdnsip [/file get "currentip.txt" contents]
:log info "currentip.txt = $currentdnsip"
--------------------------
Upon the first running the output in the LOG ends with "got here".
Yet, the file was created and the contents are correct.
If I remove that file and rerun the script the results are the SAME.
If I do NOT remove the file and then rerun the script the output does include the info entry with "currentip.txt = ...." with the correct result.
I have run this a zillion times and the two alternatives always produce the same inconsistent results.
What is wrong here?
Thanks for any help!
oldunixguy