aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ram_perc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ram_perc')
-rwxr-xr-xmodules/ram_perc13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/ram_perc b/modules/ram_perc
new file mode 100755
index 0000000..40c2b2f
--- /dev/null
+++ b/modules/ram_perc
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Prints the total ram and used ram in Mb
+
+PREFIX=' '
+
+get_ram()
+{
+ USED_RAM=$(free | awk '/Mem/{printf("%d"), $3/$2*100}')
+ echo "$PREFIX$USED_RAM%"
+}
+
+get_ram