Hi all i need to run this script over Mikrotik from SSH session:
1- in the first case: I want to create a variable. then I want the next command to be executed taking into account the variable itself.
And change passwd as variable
*************************************************************
@echo off
ssh -t admin@"mikrotik ip" -p 22 –pw "password Mikrotik" |:global myVar "value" | '/user set Main password=$myVar'
pause
**************************************************************
2- in this second case I would like to have the possibility to run the script only - in the lines below I put the example of the created script
********************************************************************************************************************
@echo off
ssh -t admin@"mikrotik ip" -p 22 –pw "password Mikrotik" | /system/script> run number:1
pause
********************************************************************************************************************
Script done as ---------------------------------> | :global myVar "value"| add name=PasswordRecovery source=":user/set Main password=$myVar"
[admin@MikroTik] /system/script> print
Flags: I - invalid
0 name="Passwdsec" owner="Main" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
dont-require-permissions=no run-count=0 source= [:execute {/user set Main password=Passwd1}]
is first time that i create script sorry and thanks in advanced