Skip to content

Instantly share code, notes, and snippets.

@AdrianKoshka
Created February 1, 2016 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdrianKoshka/4bd297bc6d2b9f0926cc to your computer and use it in GitHub Desktop.
Save AdrianKoshka/4bd297bc6d2b9f0926cc to your computer and use it in GitHub Desktop.
A little WoL script for doing updates.
#!/usr/bin/env bash
BCAST_IP="your broadcast IP here"
MAC_ADDR="your mac address here"
wakeonlan -i $BCAST_IP $MAC_ADDR #send magic packet to computer
echo "Waiting for boot"
sleep 2m # this is just filler, waits two minutes for computer to boot.
ssh everyone@192.168.0.6 -t "sudo apt-get update; sudo apt-get upgrade; sudo poweroff"
#runs commands, then shuts computer down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment