aboutsummaryrefslogtreecommitdiff
path: root/modules/localip
diff options
context:
space:
mode:
Diffstat (limited to 'modules/localip')
-rwxr-xr-xmodules/localip4
1 files changed, 3 insertions, 1 deletions
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