Olá,
Gostaria de uma ajuda no scritp que estou fazendo, preciso enviar 3
vezes o Enter para concluir o backup do roteador, ou algum script em
shell semelhante.

#!/bin/sh

port=23
senha=admin
enable2=admin

cat devicelist | while read rtname host


# armazena hora e data atual
time=`date +%d%m%y%H%M`



do

if [ $rtname = "fim" ];then
    echo 'Final do Arquivo'
exit
else

touch /tftpboot/$rtname-$time
chmod 777 /tftpboot/$rtname-$time

echo telnet ${host}
sleep 1
echo ${senha}
sleep 1
echo enable
sleep 1
echo ${enable2}
sleep 1
echo copy running-config tftp://10.52.249.2/$rtname-$time

--------------------------------------------
Aqui preciso enviar 3 enter

________________________
sleep 1
echo exit
echo exit

fi

Atenciosamente,
Fabian Ilha

Responder a