I need to create a shell that makes choices on an interactive menu. In the manual version I execute:
- ssh connection to the host
- I select the menu item 4 (console start)
- I run the "show vpn connection" command (it returns a number)
- I type "exit" to close the console
- I select the menu item 0 (exit)
I tried to create a shell of this type:
#!/bin/bash
HOST=172.19.0.9
USER="admin"
PASSWORD="xxxxxxxxxx"
COMMAND="show vpn connection status"
SSH="/usr/bin/ssh"
$SSH -tt $USER@$HOST << EOF
4
$COMMAND
exit
0
EOF
It asks me for the password but no output is returned to me. I only get the message "Connection to $HOST closed." Can anyone help me? Thanks in advance