I have a script that connects to a server using ssh
. While in a loop, it fails to connect to the second server after connecting to the first one. I guess I have to quit from that server to come back to the calling script. How do I quit the ssh session?
while read dbname myip
do
ssh root@$myip "mysqldump - some command " | mysql -hhost -u -p myLocalDatabase > /dev/null 2>&1
done << iplist
db1 111.111.111.111
xyz 222.222.222.222
iplist