Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Easily wake a networked Mac via Automator Network
I've got my mini hooked up in one room to a TV. It doesn't really have easy access to a keyboard and mouse, but it is connected to a huge external hard drive that I store all sorts of files on. So sometimes, when the mini is asleep I need at the files. Searching on Google for "wake mac on lan" took me to this older hint, which hasn't had much action lately.

After trying the hints on that page, the problem was that after waking the mini, I would still have a terminal window open. Now there may be away around that, but I couldn't find one. So I took the information I learned there and plugged it into an Automator workflow, using the Automator: Run Shell Script action. The Shell should be /usr/bin/python, the Pass input should be to stdin, and the body of the script should be:
#!/usr/bin/env python
import socket
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.sendto('xff'*6+'x00x11x22x33x44x5a'*16, ('192.168.1.255', 9))
You will have to replace the 00, 11, 22, 33, 44, 5a with your own mac address, of course -- you can find this in the Network System Preferences panel.

Then save the Automator action as an application or a Finder plug-in. When it is run, there is no Terminal window. (I saved mine as an application, changed the icon to a picture of a mini, and now I have an icon in my dock that, when clicked, wakes my mini in the other room).
    •    
  • Currently 3.00 / 5
  You rated: 4 / 5 (5 votes cast)
 
[14,152 views]  

10.4: Easily wake a networked Mac via Automator | 8 comments | Create New Account
Click here to return to the '10.4: Easily wake a networked Mac via Automator' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
WakeOnLan
Authored by: RickoKid on Oct 24, '07 08:04:53AM
This is a great hint for a two Mac solution. If you need to wake/sleep more Macs (or just want a shiny GUI!) try WakeOnLAN.

BTW, I'm nothing to do with the project, just a satisifed user.

[ Reply to This | # ]
10.4: Easily wake a networked Mac via Automator
Authored by: i-scholar on Oct 24, '07 08:57:38AM

Alternatively use the online command tool wakeonlan available both from Fink and Darwin Ports. It is indeed a Perl script.

You may also want to check sleepnow.



[ Reply to This | # ]
10.4: Easily wake a networked Mac via Automator
Authored by: adrianm on Oct 24, '07 11:41:48AM

Pity these won't wake a Mac that's only connected via WiFi.

---
~/.sig: not found



[ Reply to This | # ]
10.4: Easily wake a networked Mac via Automator
Authored by: ctierney on Oct 25, '07 07:03:21AM

Do you mean that airport cards are not "magic packet" aware?
That might explain why test on my home wifi didn't work.
--
Cole



[ Reply to This | # ]
10.4: Easily wake a networked Mac via Automator
Authored by: ctierney on Oct 24, '07 11:45:00AM
Hello, For so reason the python script didn't work for me, but netcat did (not by broadcasting though):
#!/bin/sh

{ for (( i = 1; i <=  6; i++ )); do printf "\xff"; done
  for (( i = 1; i <= 16; i++ )); do printf "\x00\x11\x22\x33\x44\x5a"; done
} | nc -uw1 192.168.1.75 9
--
Cole

[ Reply to This | # ]
10.4: Easily wake a networked Mac via Automator
Authored by: mzs on Oct 24, '07 12:14:49PM

Wait for 192.168.1.75 to not be in in your ARP table, then that will not work, hence the use of the broadcast.



[ Reply to This | # ]
10.4: Easily wake a networked Mac via Automator
Authored by: ctierney on Oct 24, '07 01:54:06PM

The netcat solution doesn't work with broadcast. Maybe it something to do with my network at work. I'll try both the python and netcat version at home.
--
Cole



[ Reply to This | # ]
10.4: Easily wake a networked Mac via Automator
Authored by: ctierney on Oct 24, '07 03:38:23PM

Still no go at home with either netcat or python. Cool hint, though! I'd love to get it working.
--
Cole



[ Reply to This | # ]