diff options
Diffstat (limited to 'modules/localip')
-rwxr-xr-x | modules/localip | 14 |
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 |