Community discussions

MikroTik App
 
karaYusuf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Wed Oct 12, 2022 11:07 am

I'm unable to manually convert a script to an "add script" function

Fri Oct 14, 2022 12:57 pm

Hello everyone,
I wanted to add a script in the terminal but the variables are getting lost if i look in the log of the script list.
I'm sorry. I'm new to this hole thing.
If I write the following code in Terminal everthing seems to be normal.
/system script
add dont-require-permissions=no name=container-run owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="\
    \r\
    \n:global myCon do={:return};\r\
    \n:global containerlist [$myCon];\r\
    \n/container start $containerlist;\r\
    \n/container shell $containerlist;\r\
    \n/delay 1;\r\
    \n/container stop $containerlist;"
But if I look in the script list what is logged it will show me the following code:
:global myCon do={:return};
:global containerlist [];
/container start ;
/container shell ;
/delay 1
/container stop ;
My variables are lost and i can't see why it behave like this.
Thank you for your help
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: I'm unable to manually convert a script to an "add script" function

Fri Oct 14, 2022 7:07 pm

Its better that you write what you like to do. What is the goal?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: I'm unable to manually convert a script to an "add script" function

Sat Oct 15, 2022 2:27 am

Do not post twice the same question,
and also write well the topic tilte:
"Variables getting lost in the logging of script list" it's incomprehensible,
changed to more adequate: "I'm unable to manually convert a script to an "add script" function"

Continue here, already replied:
viewtopic.php?p=961804#p961804

Who is online

Users browsing this forum: JDF, miks and 24 guests