Script stops on first line (no error)

I’m trying to execute this simple script:

/ip add set [/ip add find comment=static] disabled=yes];
/ip r set [/ip r find comment=static] disabled=yes];
/ip dhcp-cl set [/ip dhcp-cl find interface=wan] disabled=no;

It works fine when pasted into a terminal, but when executed from the script it only runs the first line. I’ve tried re ordering the lines and it sill runs the first line and stops.

Thanks
Mike

There’s a mismatch of closing “]”. You have one “[”, and two “]”. Remove the outer “]”, i.e.

/ip add set [/ip add find comment=static] disabled=yes;
/ip r set [/ip r find comment=static] disabled=yes;
/ip dhcp-cl set [/ip dhcp-cl find interface=wan] disabled=no;

If you try to surround the entire script with “{” and “}”, you’ll see it.