mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
20 lines
351 B
Bash
Executable File
20 lines
351 B
Bash
Executable File
#!/bin/sh
|
|
|
|
mem=$(free | awk '/^Mem:/ {print $3/$2 * 100.0}')
|
|
mem=${mem%.*}
|
|
|
|
if [ "$mem" -ge 90 ]; then
|
|
color="#c7162b"
|
|
elif [ "$mem" -ge 70 ]; then
|
|
color="#e95420"
|
|
else
|
|
color="#d0d0d0"
|
|
fi
|
|
|
|
used=$(free -h | awk '/^Mem:/ {print $3}')
|
|
total=$(free -h | awk '/^Mem:/ {print $2}')
|
|
|
|
echo "RAM $used/$total"
|
|
echo "RAM $used/$total"
|
|
echo "$color"
|