# Script that checkins if computer is connected to a specific wireless network (dd-wrt But you can wake up a wired system from a wireless system. Note: You cannot wake up systems using wireless cards, it's a wireless protocol limit. I have a Wake on lan for Linux, and I usually use my Linux to wake up the Mac. I have Mac, but I don't know any CLI utlity for Wake on Lan, you can find it on some Mac site. Run "showmount -e " on Mac, and it'll display exported shares on Linux. So "if $ping_sts is not equal to zero" then wake up the linux box and check for nfs exports. I'm being very general here, you may want to read up more on exit codes. An exit of zero means that program or utility ran without any problems, which is usually good. If code is not zero, then there was a problem. You can then put the code in a variable (look at Jean-Pierre's post), other wise shell will forget about it. It then gets an exit code on completion (like any other Unix program). The ping sends just one packet to your desired IP address. I was just giving him some pointers, you are right, it will show echo's exit code. Which sort of scripting should I use bash? pearl? python?Īre there any good tutorials out there that would help a newbee scripter accomplish this?ĭoes anyone know what command i could run to see if the linux box is sucessufully exporting to the macbook, or would it just be easier to ping the macbook? and then use the response to shut down the linux box. Has anyone already done this so I don't have to write the script? if neither of these are true then run ping, if no response send the magic packet to the linux box and start it up. Then running showmount and then reading from the output if the NFS mount on the linux box is up. It looks as if I can pull the info as to wether or not my macbook is on my home wireless network from reading a line in traceroute. When the linux box is on, run a cron command every minute to see if it is exporting NFS to the said Macbook (or i could just ping the macbook) If not (or no ping) have the linux box shut down in to a wakeable on lan state. If the Macbook gets no ping send the magic packet to linux box and wake it up then wait for the linux box to boot and then mount the necessary NFS mounts. If this is true then check if the NFS mount from the linux box is mounted. Run a cron command on the mac every minute that checks if I am on my home wireless network (the linux box is wired to the same router as the macbook gets wireless from). The server will be a linux box with a wake on lan card. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,įITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.I have a MacBook running osx that I want to use as an nfs client. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR The above copyright notice and this permission notice shall be included in allĬopies or substantial portions of the Software. To use, copy, modify, merge, publish, distribute, sublicense, and/or sellĬopies of the Software, and to permit persons to whom the Software isįurnished to do so, subject to the following conditions: In the Software without restriction, including without limitation the rights Of this software and associated documentation files (the "Software"), to deal Permission is hereby granted, free of charge, to any person obtaining a copy WoL.sh is distributed under the MIT License. This technique is known as "Wake-on-LAN" (for a computer using a wired connection) or "Wake-on-WLAN" (for a computer using a wireless connection). What is Wake-on-LAN or Wake-on-WLAN?Ī computer can be configured to wake from sleep when it receieves a special network message known as a "Magic Packet". on a company machine) or there may be concerns over installing new software. But there are many scenarios where installing a program is inappropriate or not allowed (e.g. These programs are well-tested and probably contain more features than WoL.sh. A common example is "wakeonlan" for Macs. Most authors on the web recommend dedicated programs to perform Wake-on-LAN. This command will broadcast a magic packet to all systems at port 9.The target computer's MAC address is 0F:1E:2D:3C:4B:5A.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |