Skip to content

Instantly share code, notes, and snippets.

@skakri
Created April 30, 2015 12:40
Show Gist options
  • Save skakri/e11a3eec1dd866219b83 to your computer and use it in GitHub Desktop.
Save skakri/e11a3eec1dd866219b83 to your computer and use it in GitHub Desktop.
broadcast-ip.sh
#!/bin/sh
# Broadcasts IP on 20420 (UDP) to local network.
# To get IP of this device, run `nc -ul 20420` and wait a bit.
ip -o -4 addr show | awk -F '[ /]+' '/global/ {print $4}' | socat - "UDP-DATAGRAM:255.255.255.255:20420,broadcast"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment