diff --git a/root/.profile.d/00_functions.conf b/root/.profile.d/00_functions.conf index 9dbb303..1a23aab 100644 --- a/root/.profile.d/00_functions.conf +++ b/root/.profile.d/00_functions.conf @@ -17,10 +17,26 @@ function hddtop() { } # List all ip's v4 -ip4all () { - ip -4 -o addr \ - | grep -v 127.0.0 \ - | awk -v blue="$(tput bold;tput setaf 4)" -v reset="$(tput sgr0)" '{printf "%s\t%s\t%s %s %s\n",$2,":",blue,$4,reset}' +# +# OLD +#ip4all () { +# ip -4 -o addr \ +# | grep -v 127.0.0 \ +# | awk -v blue="$(tput bold;tput setaf 4)" -v reset="$(tput sgr0)" '{printf "%s\t%s\t%s %s %s\n",$2,":",blue,$4,reset}' +#} +# +# NEW +function ip4all() +{ + echo -e "\033[32mInterfaces and IP\033[00m :" + # Search all interfaces + LISTE_INTERFACES=$(ip -4 a s|grep -P '^[0-9]+'|grep -v '^1:'|awk -F: '{print $2}'|sed 's/@.*//') + # For all interfaces, get all ip's + for INTERFACE in $LISTE_INTERFACES + do + echo -e "\t- \033[33m$INTERFACE\033[00m" + ip -4 a s $INTERFACE |grep inet|awk '{print "\011\011" $2}' + done } # Show top usage memory diff --git a/root/.profile.d/01_stats_connexion.conf b/root/.profile.d/01_stats_connexion.conf index 8907744..ceb416c 100644 --- a/root/.profile.d/01_stats_connexion.conf +++ b/root/.profile.d/01_stats_connexion.conf @@ -37,6 +37,7 @@ processes=`ps aux | wc -l` echo echo -e "OS\t:\t `lsb_release -d | sed -e 's/Description://g' | sed 's/^[ \t]*//'`" echo -e "Uptime\t:\t $(uptime -p)" +echo ip4all echo hddtop