Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/ash
- oldnum=meh
- oldinfo=""
- oldiface=""
- ip -o addr | while read num iface stuff
- do
- if [ "$num" != "$oldnum" ]
- then
- c=`echo $oldinfo | egrep "inet|inet6" | awk '{print $2}' | egrep -v "^f
- e80:" | wc -l`
- oldinfo="$stuff"
- oldnum="$num"
- if [ $c -gt 0 ]
- then
- case $oldiface in
- lo:) ;;
- *) echo $oldiface | cut -f1 -d:
- esac
- fi
- oldiface=$iface
- else
- oldinfo=`echo -e "$oldinfo\n$stuff"`
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement