Use /sys to get the list of network interface.
This commit is contained in:
parent
70392b1e4e
commit
1f499de4ce
7
zshrc
7
zshrc
|
@ -344,8 +344,11 @@ function ippub()
|
||||||
#Récupère l'adresse IP (privee)
|
#Récupère l'adresse IP (privee)
|
||||||
function ippriv()
|
function ippriv()
|
||||||
{
|
{
|
||||||
printf 'eth0: %s\n' $(ip a s eth0|grep "inet "|awk '{print $2}')
|
for interface in $(find /sys/class/net/ ! -name lo -type l -printf "%f\n" | sort);
|
||||||
printf 'wlan0: %s\n' $(ip a s wlan0|grep "inet "|awk '{print $2}')
|
do
|
||||||
|
IP_INTER=$(ip a s ${interface}|grep "inet "|awk '{print $2}')
|
||||||
|
printf '%b' "${WHITEB}${interface}${RESET}: ${IP_INTER}\n"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue