I have a script to shutdown the computers in my classroom running Ubuntu 22.04. The script shuts down all the computers, but hangs and does not close. If there something else I should add to the script or change. hothost is a file with the IP addresses of the computers I wish to turn off.
#!/bin/bash while read host; do sshpass -p 123456 ssh "root@$host" shutdown -h now & done < hothost