aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-06 16:26:36 +0000
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-11-06 16:26:36 +0000
commit3587e006fab760fa4add986718abd71f9077de01 (patch)
treeb62bf759ede5d57525397d513bdce5a624593413
parentd5a6b65c28795f363f9df6b12a0a1f226d846493 (diff)
Modifications to bar.sh and localip
-rwxr-xr-xbar.sh2
-rwxr-xr-xmodules/localip4
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