Update 'myip.sh'

This commit is contained in:
2023-05-03 00:35:39 +02:00
parent 372d8fc41b
commit b76c1edb93

View File

@@ -4,7 +4,7 @@ function get_ip {
ip a show $1 | grep -m 1 inet | awk '{print $2}' | cut -d / -f 1
}
INTERFACES=$(ip a show | grep -E "^[0-9]:" | cut -d ' ' -f 2 | cut -d : -f 1)
INTERFACES=$( ip a show | grep -E "^[0-9]{0,3}:" | cut -d ' ' -f 2 | cut -d : -f 1 )
for ni in $INTERFACES
do