Page 1 of 1

Command execution not working via script

Posted: Sat Jan 11, 2025 1:32 am
by cyrusd
Hi,

I'm trying to run the command below via a script. It runs perfectly fine in the terminal as expected, but when I write it in a script and run it, nothing happens.
log: executing script ssh-script from winbox failed, please check it manually

Script :
/system ssh address=y.y.y.y user=admin command="/user-manager user set [find name=x-x.x.x] disabled=no"

(ssh keys used for authentication)
After some investigation, I concluded that the problem is that Router A (SSH client) cannot connect to Router B (SSH server) via the script.
how to solve this?

Re: Command execution not working via script

Posted: Sat Jan 11, 2025 9:13 am
by rextended
It's on one line? Can not be on two parts in scripts like that.

Re: Command execution not working via script

Posted: Sat Jan 11, 2025 9:47 am
by cyrusd
yes, Its on one line.
Image

Re: Command execution not working via script  [SOLVED]

Posted: Sat Jan 11, 2025 7:21 pm
by rextended
non interactive is /system ssh-exec

Re: Command execution not working via script

Posted: Sat Jan 11, 2025 9:54 pm
by cyrusd
Great help! Thank you.