adding ipa

This commit is contained in:
tengel 2024-03-20 11:28:46 -05:00
parent 8fb339b3a2
commit b25d8cc3fb

9
shell/ipa.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
#
# SPDX-License-Identifier: MIT
[ -n "$1" ] || exit 1
IP=$(ip -4 -o addr show dev "$1" primary 2>/dev/null)
IP=${IP%%/*}
IP=${IP##* }
[ -n "$IP" ] && echo "$IP" || exit 1