Code: Select all
:global foo do={
#foothings;
#append $1 in a log file with a line like
/file set $logfile contents=( [/file get $logfile contents] . "$1\n\r" );
};
:global bar do={
#barthings
$foo "frombar";
};
#mainthings;
$foo "frommain1";
$bar ;
$foo "frommain2";
/system reset-configuration no-defaults=yes
I copy the rsc file via winbox in mac mode.
then mactelnet and
/import myscript.rsc
Everything works well
the output file is as expected
Code: Select all
frommain1
frombar
frommain2
if I do
/system reset-configuration no-defaults=yes run-after-reset=myscript.rsc
It seems that some subroutines are not executed.
The script do not crash. it goes to its end.
but all the foo call from inside of bar are ignored.
the bar function is called because "barthings" are done, but not the foothings when called from bar.
the output file is
Code: Select all
frommain1
frommain2
Is there a workaround ?
Note: I'm testing this on a hAP RB941 2nD
The debugging is quite hard since it does not have a console port.
I will continue testing on RB2011 and continue to post here If i find something.