![]() You can see all of the filters for the describe-instances command in the documentation. It generates the standard AMD Magic Packet format, optionally with a password included. If you have a sufficiently bloaty netcat (BusyBox can have one of two nc. ether-wake is a program that generates and transmits a Wake-On-LAN (WOL) 'Magic Packet', used for restarting machines that have been soft-powered-down (ACPI D3-warm state). If your BusyBox doesn't have it, consider recompiling BusyBox to include it. The ether-wake command in BusyBox is exactly what you're after. The second is the -filters option which, as the name implies, lets you filter the results based on a lot of criteria. You need something that's capable of sending an Ethernet packet that will be seen by the device you want to wake up. One is the -query option which lets you pull data out of the returned JSON data. This uses two very powerful features of the CLI. UPDATE: I created a PHP script that runs on a web server with SSL on my Raspberry Pi. This in turn wakes up my pc and as you see in the video, my PC turns on. | xargs aws ec2 start-instances -instance-ids The action that will be started is a SSH connection to my Raspberry Pi, then a wakeonlan command with the mac address of my desktop pc will be executed on my Raspberry Pi. "Name=tag-key,Values=WakeOnLAN" -output text filters "Name=instance-state-name,Values=stopped" Its one command line but I have wrapped for formatting. Here is how to do the same on one line, all be it only within a single region. If you run it make sure it has privilege to perform the actions, a role on an EC2 instance makes this easy. The script simply goes through all of your instances in each region, finding those that have the WakeOnLAN tag and that are stopped, then starts them. How would you approach this in AWS? You can fire of an API call to start any instance, but what if you wanted to make this easier? Simply tag your instances with an identifiable tag, such as "WakeOnLAN" and then run the following script (I prefer Ruby).ĪWS.regions.sort_by(&:name).each do |region| But it also shows not thinking of infrastructure as code. ![]() Is Wake-on-LAN supported in Amazon Web Services.
0 Comments
Leave a Reply. |