move modules to ./modules
This commit is contained in:
29
modules/ram
Executable file
29
modules/ram
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
[[ ${BLOCK_INSTANCE} == 'swap' ]] && TYPE="SwapFree" || TYPE="MemAvailable"
|
||||
gawk -v type="$TYPE" '
|
||||
$0 ~ type {
|
||||
mfg=$2/1024^2
|
||||
mfm=$2/1024
|
||||
}
|
||||
END {
|
||||
if (mfg > 2) {
|
||||
printf("%.1f GB", mfg)
|
||||
} else {
|
||||
printf("%.0f MB", mfm)
|
||||
}
|
||||
print("\n")
|
||||
if (mfg > 5) {
|
||||
print("#04B431\n")
|
||||
} else if (mfg > 4) {
|
||||
print("#A8FF00\n")
|
||||
} else if (mfg > 3) {
|
||||
print("#FFF600\n")
|
||||
} else if (mfg > 2) {
|
||||
print("#FFAE00\n")
|
||||
} else if (mfg > 1) {
|
||||
print("#FF0000\n")
|
||||
} else {
|
||||
exit 33
|
||||
}
|
||||
}
|
||||
' /proc/meminfo
|
Reference in New Issue
Block a user