More complicated commands

Posted on
Mon Sep 03, 2018 10:56 am
lanbrown offline
Posts: 673
Joined: Sep 26, 2017

More complicated commands

Are there any plans to allow more complicated SSH commands?

Here is an example; a username and password are used to authenticate. Once authenticated, a series of commands are then needed. Here is an example:
Code: Select all
config t
int fa 0/2
shutdown
no shutdown
exit


Ideally there would be a delay between the shutdown and the no shutdown.

Thanks

Posted on
Sat Oct 06, 2018 8:53 pm
jheddings offline
User avatar
Posts: 108
Joined: Dec 01, 2013
Location: Denver, CO

Re: More complicated commands

Thanks for the suggestion! Would you want this as part of the SSH Device advanced config?

Posted on
Sat Oct 06, 2018 9:24 pm
lanbrown offline
Posts: 673
Joined: Sep 26, 2017

Re: More complicated commands

I would say yes, maybe just a window where you can put the "script" in? Also, anyway to just use username and passwords as well? I'm not worried about having a username and password in Indigo or the plugin as I can limit what the account can actually do. I can use a key pair though, so being able to just run a set of commands or script is the feature I would really like to see.

Posted on
Sat Oct 06, 2018 9:30 pm
jheddings offline
User avatar
Posts: 108
Joined: Dec 01, 2013
Location: Denver, CO

Re: More complicated commands

Let me think on the script / multiple commands option a bit. There is not a multi-line config UI field in Indigo (that I know of) so I'll have to see what can be done. I'm currently using this device to shut down computers when there is a power outage or water leak detected... Do you have another use case in mind?

On the username / password... The SSH client on macOS actually doesn't allow you to set a password via command line. I've been trying to get it to work via stdin, but so far it hasn't worked properly. I also use the SSH keypair option, since that seems to be the only supported option. I'll keep at it, though. I agree that just username / password is much easier to deal with.

BTW: a workaround (that I'm sure you have considered) is to place the script on your remote server (/usr/local/sbin/safe_shutdown or something) and configure the SSH Device to call that. Then you could control the precise shutdown sequence on your server whether it was called from Indigo or if you were administering locally.

Posted on
Sat Oct 06, 2018 9:47 pm
lanbrown offline
Posts: 673
Joined: Sep 26, 2017

Re: More complicated commands

Could you incorporate sshpass within the plugin? If so, that would get around the username and password not being accepted by the SSH.

I did think about placing a script on the remote device. The firmware can be upgraded but not changed. There are a few ways to get it to work.

Posted on
Sun Oct 07, 2018 3:11 pm
lanbrown offline
Posts: 673
Joined: Sep 26, 2017

Re: More complicated commands

Look at this thread, does this help you?

https://forums.indigodomo.com/viewtopic.php?f=164&t=21402

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest