waking on network activity

larry98765

Registered
Hi All,

How do I set my mac to wake for network activity? Everytime I try to connect via afp from my powerbook to my desktop G4, the PowerBook hangs if the G4 is asleep.

There's a setting for wake when the modem detects a ring, but how about when the network detects a request?
 
I developed a script for this exact purpose today!!

Code:
set mac_addr to "00:30:65:7C:76:DA"

display dialog "What do you want to do?" buttons {"Cancel", "Wake Remote Mac"} default button 2
set res to the button returned of the result
if res is "Wake Remote Mac" then
	try
		do shell script "wol " & mac_addr
		display dialog "Remote Mac Should be awake!" buttons {"Ok"} giving up after 5
	on error
		display dialog "Error waking iMac on " & mac_addr buttons {"Ok"} default button 1 giving up after 5
		
	end try
	
end if
This is just a portion of the script - mine also checks if the remote mac in question is awake, and if it is it asks if you want to put it to sleep.


you will also need wol (wake on lan) click here to get it
http://www.gknw.de/cgi_bin/downlcnt.pl?wol_mac.tar.gz

you will need to move the wol file to /usr/bin

uise terminal to do this

sudo cp Desktop/wol/wol /usr/bin/

presuming Desktop/wol/wol is the path to the wol file.

Of course there is an easier way but i wanted to script it. If you just want to wake a remote mac try WakeUp - search for it on versiontracker.com
 
damn smilies!!! and dont for get to replace the mac_addr with th eone of the mac you are waking!
 
profx --

Thanks. I looked into using WakeUp, but a comment on VersionTracker says it doesn't work with wirelessly connected macs. Does your script work with wireless?

EDIT: I just downloaded and tried WakeUp and it works like a charm. As long as the TARGET machine is wired to the network, it works. If the target machine is airport, the antennae sleeps along with the rest of it, and can't be told to wake.

Thanks for the tip!
 
Back
Top