adding ipa
This commit is contained in:
parent
8fb339b3a2
commit
b25d8cc3fb
1 changed files with 9 additions and 0 deletions
9
shell/ipa.sh
Executable file
9
shell/ipa.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue