Created
December 10, 2013 18:12
-
-
Save championswimmer/7895241 to your computer and use it in GitHub Desktop.
boot my diveboard server
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 | |
if [ $1 ] ; then | |
wakeonlan -i ${1} -p 7 1c:6f:65:41:c0:93 | |
wakeonlan -i ${1} -p 7 1c:6f:65:41:c0:93 | |
IPCHECK=0 | |
sleep 30 | |
while [ $IPCHECK ] | |
do | |
ping -c 1 ${1} | |
if [ $? -eq 0 ] ; then | |
IPCHECK=1 | |
ssh ${1} | |
else | |
echo "Server is starting up. We are waiting." | |
fi | |
sleep 15 | |
done | |
else | |
WOL_IP=192.168.1.255 | |
wakeonlan -i ${WOL_IP} -p 7 1c:6f:65:41:c0:93 | |
wakeonlan -i ${WOL_IP} -p 7 1c:6f:65:41:c0:93 | |
IPCHECK=0 | |
sleep 30 | |
while [ $IPCHECK ] | |
do | |
ping -c 1 192.168.1.101 | |
if [ $? -eq 0 ] ; then | |
IPCHECK=1 | |
ssh diveboard | |
else | |
echo "Server is starting up. We are waiting." | |
fi | |
sleep 15 | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment