mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Handle strange interface names due to lxd/lxc
This commit is contained in:
parent
47400ebc28
commit
6a5088e450
1 changed files with 3 additions and 1 deletions
|
|
@ -75,7 +75,9 @@ yspep_my_ip() {
|
|||
else
|
||||
echo -n $(
|
||||
while read num dev etc; do
|
||||
ip -d -o addr sh ${dev:0: -1} |
|
||||
dev="${dev:0: -1}" # Remove trailing colon
|
||||
dev="${dev//@*/}" # Remove "@xxx" prefix
|
||||
ip -d -o addr sh ${dev} |
|
||||
awk '$3 == "inet" {sub(/\/[0-9]+/, "", $4); print "%F{022}"$2":%F{green}"$4}';
|
||||
done <<<"$(
|
||||
ip -d -o link sh |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue