From 3587e006fab760fa4add986718abd71f9077de01 Mon Sep 17 00:00:00 2001 From: "Archie Hilton (thytom)" Date: Wed, 6 Nov 2019 16:26:36 +0000 Subject: [PATCH] Modifications to bar.sh and localip --- bar.sh | 2 +- modules/localip | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bar.sh b/bar.sh index 1a98bf1..a600381 100755 --- a/bar.sh +++ b/bar.sh @@ -47,7 +47,7 @@ run_module() fi if [[ "$out" = " " ]]; then - echo " " > "$OUTPUT_CACHE$module" + echo "" > "$OUTPUT_CACHE$module" elif [[ ! "$out" = "" ]]; then out="$out$SEPARATOR." echo "$out" > "$OUTPUT_CACHE$module" diff --git a/modules/localip b/modules/localip index 39629db..91a74c0 100755 --- a/modules/localip +++ b/modules/localip @@ -6,7 +6,9 @@ PREFIX='ﯱ ' get_local_ip() { - echo "$PREFIX$(hostname -i)" + IP=$(ip addr | grep -e "inet " | awk 'NR==2' | sed 's/^.*inet.//g; s/\/.*//g') + + echo "$PREFIX$IP" } get_local_ip