I have 20 nodes out of which 5 does not ssh(this is expected).
These values are dynamically pulled from a source.
Below is my code trying to check if they are able to SSH:
for skip_node in "${skip_nodes[@]}"
do
for node in "${nodes[@]}"
do
if [[ $node != $skip_node ]]; then continue; fi
<I have my ssh logic working here>
if [ $? -ne 0 ]; then
UNABLE_TO_SSH+=" ${node}"
(( ERROR_COUNT += 1 ))
fi
done
done
This script is failing because array nodes again contains those nodes which are in skip_nodes.
Any help on how should can I solve this problem?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…