From c2c48e2fb05aaffdfccd621b41aaa0e9559f8740 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Wed, 20 Oct 2021 18:01:36 -0500 Subject: whats my ip script --- bar/memuse | 3 +++ bar/wmip | 2 ++ misc/wmip | 1 + 3 files changed, 6 insertions(+) create mode 100755 bar/memuse create mode 100755 bar/wmip create mode 120000 misc/wmip diff --git a/bar/memuse b/bar/memuse new file mode 100755 index 0000000..c5399b8 --- /dev/null +++ b/bar/memuse @@ -0,0 +1,3 @@ +#!/bin/sh +awk '{ if(!total){ total = $2 } else if(!free){ free = $2 } else{ exit } } END{ print int(((total-free)*100)/total)"%" }' /proc/meminfo +#free -b | awk '/^Mem/ { print int($3*100/$2)"%" }' diff --git a/bar/wmip b/bar/wmip new file mode 100755 index 0000000..63e5676 --- /dev/null +++ b/bar/wmip @@ -0,0 +1,2 @@ +#!/bin/sh +ip addr | awk '!/ lo/ && /inet / { sub(/\/.*/, "", $2); print $2 }' diff --git a/misc/wmip b/misc/wmip new file mode 120000 index 0000000..44c49c2 --- /dev/null +++ b/misc/wmip @@ -0,0 +1 @@ +../bar/wmip \ No newline at end of file -- cgit v1.2.3