rwxrob-dot/scripts/ips
Rob Muhlestein 2ea0289e9f Rebase
2022-02-09 02:29:05 -05:00

19 lines
263 B
Bash
Executable File

#!/usr/bin/env bash
getnics () {
while IFS= read -r line; do
echo ${line%% *}
done < <(ip --br -4 a)
}
# complete -W "$(ips)" ips
if [ -z "$1" ]; then
getnics
exit 0
fi
for i in "$1";do
m=$(ip --br -4 a s "$1"); m=${m%\/*}; echo ${m##* }
done