Hello I've got a following script:
:local filename "test.txt"
:local content "This is a test."
/file print file=$filename where name="";
:delay 5
/file set $filename contents=$content;
Policies: read, write, test
But for some reason, requested file does not get created. Why is that? My hardware is Mikrotik hAP ac3, with RouterOS 7.2.3.
:localvariables are not cached in Terminal, but only in scripts.You can circumvent this by either using
:globalinstead or using{ }brackets:Tested with RouterOS v7.4.1.
Side note: File names (unfortunately) always end with .txt. Maximum file content size is 4096 characters.