diff options
author | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-06 16:26:36 +0000 |
---|---|---|
committer | Archie Hilton (thytom) <archie.hilton1@gmail.com> | 2019-11-06 16:26:36 +0000 |
commit | 3587e006fab760fa4add986718abd71f9077de01 (patch) | |
tree | b62bf759ede5d57525397d513bdce5a624593413 | |
parent | d5a6b65c28795f363f9df6b12a0a1f226d846493 (diff) |
Modifications to bar.sh and localip
-rwxr-xr-x | bar.sh | 2 | ||||
-rwxr-xr-x | modules/localip | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -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 |