Created
          July 31, 2013 13:14 
        
      - 
      
 - 
        
Save fixje/6121867 to your computer and use it in GitHub Desktop.  
    wake up host with wol and connect
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | ## 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