Skip to content

Instantly share code, notes, and snippets.

@Sekhmet
Created June 27, 2015 10:06
Show Gist options
  • Save Sekhmet/9db9550c771aa52b477b to your computer and use it in GitHub Desktop.
Save Sekhmet/9db9550c771aa52b477b to your computer and use it in GitHub Desktop.
Spin servers
#!/bin/bash
for i in {2..126}
do
while true
do
echo "Checking"
wget --spider -q "http://104.161.36.$(($i + 1)):7774" -T 1
if [ $? == 8 ];
then
echo "UP http://104.161.36.$(($i + 1)):7774"
vzctl start $(($i + 100))
break
else
echo "Still down http://104.161.36.$(($i + 1)):7774"
fi
sleep 5
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment