plink not allowing interactive prompt
Posted: Fri Mar 27, 2009 8:51 am
I am starting a plink session from a Windows match file. Everything logs in and the remote bash script I invoke is being executed -- works fine.
However I need to prompt the user for a single input from within the shell script on the Linux server.
The script works when run from the CLI under linux but under windows when invoked through plink I get prompted but the screen freezes and nothing works.
This is the Windows batch code:
This is the shell script
I'm not sure why this doesn't work -- if I invoke putty without user/pass it successfully prompts me -- any ideas?
However I need to prompt the user for a single input from within the shell script on the Linux server.
The script works when run from the CLI under linux but under windows when invoked through plink I get prompted but the screen freezes and nothing works.
This is the Windows batch code:
Code: Select all
@ECHO OFF
:BEGIN
START plink.exe 192.168.1.199 -l root -pw test sh /root/site_down
:END
Code: Select all
#!/bin/bash
echo "Enter the number of hours the site will be down: "
read -e HOURS
echo "Site down for $HOURS hours"