ONTAP Discussions

Non-Interactive "sp setup" Command From SSH

ArtieMan66
2,565 Views

I'm trying to configure our NetApps using Plink from SSH and I have the entire thing working except for the "sp setup" command.

 

This command is interactive and requires the user to enter "y", "n", IP, Netmask, Gateway in response to several prompts that pop up after you run the sp setup command.

 

I can't seem to find a way to automate these entries so that they don't prompt the user for input or hang the script.

 

I've tried "echo y|plink.exe .........." and that will work for the first prompt, but the second I try to add any additional inputs for the later prompts, all of the input fails (ex:  (echo y&echo n)|plink.exe .......)

 

Is there a way to pipe input into the sp setup command right from the command line of the SSH window with no user interaction?  Perhaps something I could type by hand in a manual SSH session just to verify that it works, along the lines of echo y|sp setup or echo y>(sp setup)?

 

Maybe there is some fancy command I could do using "priv set advanced"?

1 REPLY 1

georgevj
2,519 Views

For automating interactive programs, I would prefer using "expect" on a Linux system. 

A simple script for example, does telnet to a remote server and executes "ls" command;

 

#!/usr/bin/expect

spawn telnet 192.168.0.1

expect "login:"

send "root\r"

expect "Passsword:"

send "PaSsWoRd\r"

expect "#"

send "ls\r"

exit

 

dont know whether it works on windows platform 😞

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Cannot find the answer you need? No need to open a support case - just CHAT and we’ll handle it for you.
Public