RFG
1
Hello,
I’m using plink as follows:
PLINK.EXE -ssh -P 22 user@host -pw passwd -m MK.ini
When I try to run a script with commands that go into menu level does not recognize. Ex:
/system upgrade
:put [get [find version=6.42.10] status]
If you do in a single line it works. Ex:
/system upgrade;:put [get [find version=6.42.10] status]
Would anyone know the reason?
2frogs
2
In your example, “;” is still required at the end of the first line. It stands for “New Line.”
maxsaf
3
:put [system identity get name] works for me
Jotne
4
Not true anymore “New Line” works nice. No need for ; anymore.
Only if you like more commands on one line.
https://wiki.mikrotik.com/wiki/Manual:Scripting
The end of command line is represented by the token “;” or NEWLINE. Sometimes “;” or NEWLINE is not required to end the command line.
2frogs
5
I completely miss read the OP issue! Thought he was trying to issue 2 commands when I responded.
RFG
6
My intention is to first enter the menu level
/system upgrade
to execute later
:put [get [find version=6.42.10] status]
as it would in a mikrotik script
Jotne
7
/system upgrade;:put [get [find version = 6.42.10] status]
This does not work for me, it gives red error after = due to the extra space after =.
If I do remove the space, I do get this error:
no such item
What are you trying to do?
Test what version you have?
See if there are newer version?
If you like OS version?
:put [/system resource get version]
RFG
8
Sorry, the spaces were a copy and paste error. They should not really exist.
If I run direct on the terminal it works, the problem is when I try to do this through plink.
This is part of a mass update script where I need to know if the download has been completed to reboot.