Skip to content

Comment on How Wake-On-LAN works (2020)parent

Comments

Here's an equivalent shell script that only uses bash builtins, so no other software required:

  #!/bin/bash 
  mac="\\x${1//:/\\x}" 
  wol="\xFF\xFF\xFF\xFF\xFF\xFF" 
  for i in {1..16}; do wol+="$mac"; done 
  printf "$wol" > "/dev/udp/$2/9"
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.