Created
June 27, 2015 10:06
-
-
Save Sekhmet/9db9550c771aa52b477b to your computer and use it in GitHub Desktop.
Spin servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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