Currently I'm using the script below only with TELNET instead of SSH and it works great. Trying to do the same type of thing with SSH, and can't seem to get it to login.
Please Help and newby out.
#!/usr/bin/ksh
# echo "Enter switch: \c"
# read switch
# echo "Enter username: \c"
# read username
# echo "Enter password: \c"
# read password
switch=$1
dt=$(date +%m%d%y_%H%M)
username=username
password=password
for x in 1
do
{
sleep 5
echo "$password"
sleep 5
echo "yes"
sleep 5
echo "commands"
sleep 15
echo "exit;"
}|ssh -l -t username $switch>/export/home/chk/$switch.txt
cp /export/home/chk/$switch.txt /export/home/data/chk/$switch.CHK_$dt
done
Please Help and newby out.
#!/usr/bin/ksh
# echo "Enter switch: \c"
# read switch
# echo "Enter username: \c"
# read username
# echo "Enter password: \c"
# read password
switch=$1
dt=$(date +%m%d%y_%H%M)
username=username
password=password
for x in 1
do
{
sleep 5
echo "$password"
sleep 5
echo "yes"
sleep 5
echo "commands"
sleep 15
echo "exit;"
}|ssh -l -t username $switch>/export/home/chk/$switch.txt
cp /export/home/chk/$switch.txt /export/home/data/chk/$switch.CHK_$dt
done