When i run it from the CLI, the whole script works.
Any suggestions?
Code: Select all
#define global variables
:global resolveThis "www.google.nl"
:global test
:global serverfile test.conf
:global importfile import.conf
#create configscript
/system script add name=import-conf source="
/tool fetch \\
address=test.com \\
src-path=$serverfile \\
user=admin \\
mode=https \\
password=pass! \\
dst-path=$importfile \\
port=443 keep-result=yes \n
/system script add name=$importfile source=[/file get $importfile contents]
/system script run $importfile \n
"
#connect to the internet, then run script
:local continue true
while ($continue) do={
[/ip dns cache flush]
:set test [:resolve $resolveThis]
:if ($test != "") do={
/system script run import-conf
:set continue false
}
}