Skip to content

Instantly share code, notes, and snippets.

@sleexyz
Created March 24, 2014 02:23
Show Gist options
  • Save sleexyz/9733198 to your computer and use it in GitHub Desktop.
Save sleexyz/9733198 to your computer and use it in GitHub Desktop.
#!/bin/bash
#DEVICE="wlp1s0"
DEVICE="wlan0"
ip -4 addr show "$DEVICE"|grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])'|head -n 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment