mirror of
https://github.com/gwebu-team/profile.d.git
synced 2025-12-13 12:25:45 +00:00
fix: Don't alias ip if iproute is not installed.
Some checks failed
Makefile CI / build (push) Has been cancelled
Some checks failed
Makefile CI / build (push) Has been cancelled
This commit is contained in:
parent
2f07d57c86
commit
df3199976e
2 changed files with 14 additions and 8 deletions
|
|
@ -17,13 +17,16 @@ if [[ "$OSTYPE" != darwin* ]]; then
|
|||
# long format with ISO dates
|
||||
alias lll='ls --color=auto -Al "--time-style=+%Y-%m-%d %H:%M:%S GMT%z"'
|
||||
|
||||
# color ip route
|
||||
if ip -V | grep '^ip utility, iproute2-.*, libbpf' &>/dev/null; then
|
||||
# EL 8+ - "ip utility, iproute2-6.2.0, libbpf 0.5.0"
|
||||
alias ip='ip --color=auto'
|
||||
else
|
||||
# EL 7 - "ip utility, iproute2-ss170501"
|
||||
alias ip='ip -c'
|
||||
# if there is iproute installed
|
||||
if command -v ip > /dev/null; then
|
||||
# color ip route
|
||||
if ip -V | grep '^ip utility, iproute2-.*, libbpf' &>/dev/null; then
|
||||
# EL 8+ - "ip utility, iproute2-6.2.0, libbpf 0.5.0"
|
||||
alias ip='ip --color=auto'
|
||||
else
|
||||
# EL 7 - "ip utility, iproute2-ss170501"
|
||||
alias ip='ip -c'
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# MacOS aliases
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue