Skip to content

Instantly share code, notes, and snippets.

@fixje
Created July 31, 2013 13:14
Show Gist options
  • Save fixje/6121867 to your computer and use it in GitHub Desktop.
Save fixje/6121867 to your computer and use it in GitHub Desktop.
wake up host with wol and connect
## wake up xbox and connect
ssh-xbox () {
nc -z -w3 xboxkl.no-ip.org 333
if [ $? -eq 1 ]
then
echo "Waking up XBOX"
wakeonlan -i xboxkl.no-ip.org -f ~/.xbox.wol
sleep 50
fi
for i in $(seq 1 5)
do
nc -z -w3 xboxkl.no-ip.org 333
if [ $? -eq 1 ]
then
sleep 10
continue
else
ssh xbox
break
fi
echo "Connection failed!"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment