This script does everything described in the Manual way, for you, except step 1 and step 4. First off, make sure your system supports WakeOnLAN (WOL), if you know your system well, you already know if it does or doesn't. This is really common, but I haven't seen a ubuntu howto for it, people more or less peice it together from posts and blog entries and the like.