umstrukturiert
This commit is contained in:
17
.config/tmux/myip.sh
Executable file
17
.config/tmux/myip.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
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]{0,3}:" | cut -d ' ' -f 2 | cut -d : -f 1 )
|
||||
|
||||
for ni in $INTERFACES
|
||||
do
|
||||
if [[ $ni != "lo" ]] && [[ ! $ni =~ "veth" ]] && [[ ! $ni =~ "br-" ]] && [[ ! $ni =~ "docker_" ]]; then
|
||||
IP="$(get_ip $ni)"
|
||||
if [[ ! -z $IP ]]; then
|
||||
echo -n " #[fg=#${COLOR_ACCENT}]$ni #[fg=white]$IP "
|
||||
fi
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user