#/bin/bash # Run this script to run the $command in all nodes ####### define your command here #command="check_hardware.sh >> /share/apps/configrepo/check_hardware.txt" #command="hostname; ls -l /state/partition1/ext_storage" #command="reboot now" #command="hostname; which math" #command="mount -a" command="hostname;cat /etc/passwd | grep pwkoh" ####### define your command here coc-sshreachable hosts=$(cat /share/tmp/ssh-reachable.dat | awk '{if ($1 != "192.168.1.10") print $1}' | awk '$1!= "anicca" ') for i in $hosts do ssh -X -Y -oStrictHostKeyChecking=no $i "$command" done