Jean-Pierre: Sorry about that. I was just giving him some pointers, you are right, it will show echo's exit code.
So here is the explanaiton:
The ping sends just one packet to your desired IP address. It then gets an exit code on completion (like any other Unix program). You can then put the code in a variable (look at Jean-Pierre's post), other wise shell will forget about it.
"echo $ping_sts" displays the code.
If code is not zero, then there was a problem. An exit of zero means that program or utility ran without any problems, which is usually good. I'm being very general here, you may want to read up more on exit codes.
So "if $ping_sts is not equal to zero" then wake up the linux box and check for nfs exports.
Run "showmount -e <Linux IP>" on Mac, and it'll display exported shares on Linux. I have Mac, but I don't know any CLI utlity for Wake on Lan, you can find it on some Mac site. I have a Wake on lan for Linux, and I usually use my Linux to wake up the Mac.
Note: You cannot wake up systems using wireless cards, it's a wireless protocol limit. But you can wake up a wired system from a wireless system.
-Nitin