aboutsummaryrefslogtreecommitdiffstats
path: root/modules/localip
diff options
context:
space:
mode:
Diffstat (limited to 'modules/localip')
-rwxr-xr-xmodules/localip14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/localip b/modules/localip
new file mode 100755
index 0000000..91a74c0
--- /dev/null
+++ b/modules/localip
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Prints out your local IP
+
+PREFIX='ﯱ '
+
+get_local_ip()
+{
+ IP=$(ip addr | grep -e "inet " | awk 'NR==2' | sed 's/^.*inet.//g; s/\/.*//g')
+
+ echo "$PREFIX$IP"
+}
+
+get_local_ip