Files
linux_system_tuning/quick-status-check.sh
mindesbunister 2edb4a73c3 Complete Linux system optimization suite with tmpfs, zram, and German locale support
- Fixed missing setup_tmpfs() function that was causing silent failures
- Added comprehensive system scanning for browsers, IDEs, gaming caches
- Implemented detailed optimization information display for transparency
- Added German locale compatibility for 'free' command (Speicher: vs Mem:)
- Fixed division by zero errors in RAM calculations
- Created tmpfs-info.sh helper script for detailed status reporting
- Enhanced scanning to work on already-optimized systems
- Added comprehensive optimization breakdowns with purpose explanations
2025-09-23 12:11:45 +02:00

95 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
# Quick test version to see current status
echo "🔍 Current System Status Check"
echo "=============================="
# Get RAM info
ram_gb=$(free -g | awk '/^Mem:|^Speicher:/{print $2}')
echo "RAM: ${ram_gb}GB"
# Check zram
echo ""
echo "🗜️ zram Status:"
if [[ -e /dev/zram0 ]] && swapon --show | grep -q zram0; then
zram_size=$(swapon --show | grep zram0 | awk '{print $3}')
echo " ✅ Active: $zram_size"
# Calculate optimal
if [[ $ram_gb -ge 8 ]]; then
optimal_size=$((ram_gb / 2))
else
optimal_size=$((ram_gb * 3 / 4))
fi
[[ $optimal_size -lt 2 ]] && optimal_size=2
echo " 📊 Optimal: ${optimal_size}GB"
zram_size_gb=$(echo "$zram_size" | sed 's/[^0-9.]//g' | cut -d. -f1)
if [[ $zram_size_gb -lt $((optimal_size - 1)) ]] || [[ $zram_size_gb -gt $((optimal_size + 2)) ]]; then
echo " ⚠️ Size could be optimized"
else
echo " ✅ Size is optimal"
fi
else
echo " ❌ Not configured"
fi
# Check tmpfs
echo ""
echo "💾 tmpfs Cache Status:"
tmpfs_count=$(mount | grep "tmpfs.*tmpfs-cache" | wc -l)
if [[ $tmpfs_count -gt 0 ]]; then
echo " ✅ Active: $tmpfs_count mounts"
echo " 📁 Mounted caches:"
mount | grep "tmpfs.*tmpfs-cache" | awk '{print " " $3 " (" $6 ")"}' | tr -d '()' | head -5
[[ $tmpfs_count -gt 5 ]] && echo " ... and $((tmpfs_count - 5)) more"
else
echo " ❌ Not configured"
fi
# Check kernel params
echo ""
echo "⚙️ Kernel Parameters:"
if [[ -f /etc/sysctl.d/99-system-optimization.conf ]]; then
echo " ✅ Optimization config exists"
swappiness=$(sysctl -n vm.swappiness 2>/dev/null)
dirty_ratio=$(sysctl -n vm.dirty_ratio 2>/dev/null)
echo " 📊 Current: swappiness=$swappiness, dirty_ratio=$dirty_ratio"
# Calculate optimal for this system
if [[ $ram_gb -ge 16 ]]; then
opt_swap=1; opt_dirty=3
elif [[ $ram_gb -le 4 ]]; then
opt_swap=10; opt_dirty=10
else
opt_swap=5; opt_dirty=5
fi
echo " 📊 Optimal: swappiness=$opt_swap, dirty_ratio=$opt_dirty"
if [[ "$swappiness" != "$opt_swap" ]] || [[ "$dirty_ratio" != "$opt_dirty" ]]; then
echo " ⚠️ Could be optimized"
else
echo " ✅ Optimally configured"
fi
else
echo " ❌ Not optimized"
fi
# Check systemd service
echo ""
echo "🔄 Systemd Service:"
if systemctl is-enabled system-optimization.service &>/dev/null; then
if systemctl is-active system-optimization.service &>/dev/null; then
echo " ✅ Active and enabled"
else
echo " ⚠️ Enabled but not active"
fi
elif [[ -f /etc/systemd/system/system-optimization.service ]]; then
echo " ⚠️ Installed but not enabled"
else
echo " ❌ Not installed"
fi
echo ""
echo "✨ Analysis complete!"