diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-22 15:31:25 +0100 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2019-10-22 15:31:25 +0100 |
commit | 4161ad75ccce38dd0ea7e4192803385f97744e7b (patch) | |
tree | 040c56b0541ea23532666231602309561d4cae5c /modules | |
parent | d66f63d8fa6e1ac9d89ac19d44464d7ac8ccbd31 (diff) |
Added disksize module
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/disksize | 16 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/ram | 0 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/disksize b/modules/disksize new file mode 100755 index 0000000..cbbfff8 --- /dev/null +++ b/modules/disksize @@ -0,0 +1,16 @@ +#!/bin/bash + +# Prints out the total disk memory and the availeable memory + +PREFIX=' ' + +get_disk() +{ + TOTAL_SIZE=$( df -h --total / | tail -1 | awk {'printf $2'}) + USED_SIZE=$(df -h --total / | tail -1 | awk {'printf $3'}) + PERCENTAGE=$(df -h --total / | tail -1 | awk {'printf $5'}) + + echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)" +} + +get_disk diff --git a/modules/ram b/modules/ram index a2e359b..a2e359b 100644..100755 --- a/modules/ram +++ b/modules/ram |