Skip to content

Instantly share code, notes, and snippets.

@mickaelv
Created August 2, 2019 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickaelv/6229672c22c23a1131754bf91a2d3484 to your computer and use it in GitHub Desktop.
Save mickaelv/6229672c22c23a1131754bf91a2d3484 to your computer and use it in GitHub Desktop.
PowerOff multiple computers
for ip in 50 $(seq 1 154)
do
ping -q -c1 10.10.10.$ip > /dev/null
if [ $? -eq 0 ]
then
ssh user@10.10.10.$ip "poweroff" &
echo "$ip eteint"
else
echo "$ip deja eteinte"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment