I have this code :
for i in $ipb $ipc $ipd; do
ssh -i ~/.ssh/'key' 'name'@${i} /bin/bash << EOF
nohup ${install_dir}/redis-stable/src/redis-server ${install_dir}/${port}/node.conf &
EOF
let "port++"
done
which should start redis servers on all 3 ip addresses. However it currently only executes the first command(on ipb). Note: if the nohup-ed command is input manually, once the Redis server is started with the command, the user must press enter to be able to type other commands. The problem is not redis-related, but most likely comes from how the script is written, so no need to know about redis for this one I think. Ssh is also working fine.
What must I change to make it run all 3 commands (one on each ip)?
Thank you for your time and feel free to indicate if you need more info.
echo $ipb $ipc $ipd
before the loop, andecho done $i
before thedone
. Report the output. – berndbausch Mar 24 '21 at 01:31echo | nohup ...
does as well. – berndbausch Mar 24 '21 at 02:07