dots/.bin/whoamip

6 lines
112 B
Bash
Executable File

#!/usr/bin/env bash
# Get local IP
ip addr show $@ | awk '/inet / {gsub(/\/.*/,"",$2); print $2}' | tail -n 1