Make server_info.sh's output processable

This commit is contained in:
Iam54r1n4
2025-01-26 11:19:33 +00:00
parent 101dc5a934
commit 292fe7e74c

View File

@ -31,6 +31,8 @@ convert_bytes() {
fi
}
# iT'S BETTER TO PRINT BYTES ITSELF AND NOT HUMAN READABLE FORMAT BECAUSE THE CALLER SHOULD DECIDE WHAT TO PRINT
cpu_usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}')
total_ram=$(free -m | awk '/Mem:/ {print $2}')
used_ram=$(free -m | awk '/Mem:/ {print $3}')
@ -48,7 +50,7 @@ echo "📋 Total RAM: ${total_ram}MB"
echo "💻 Used RAM: ${used_ram}MB"
echo "👥 Online Users: $online_user_count"
echo
echo "🚦Total Traffic: "
#echo "🚦Total Traffic: "
if [ -f "$USERS_FILE" ]; then
total_upload=0