Skip to content

Instantly share code, notes, and snippets.

@championswimmer
Created December 10, 2013 18:12
Show Gist options
  • Save championswimmer/7895241 to your computer and use it in GitHub Desktop.
Save championswimmer/7895241 to your computer and use it in GitHub Desktop.
boot my diveboard server
#!/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