mirror of
https://github.com/rwxrob/dot
synced 2024-11-14 18:12:56 +00:00
19 lines
263 B
Bash
Executable File
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
|