Files
linux_system_tuning/quick-status-check.sh
root c4a3e9285f 🚀 Add One-Button Interactive System Optimizer
 New Features:
- Interactive one-button optimizer with smart detection
- Analyzes existing optimizations and detects suboptimal configs
- User-controlled selective optimization (no forced changes)
- Handles mixed scenarios (some optimal, some suboptimal, some missing)
- Quick status checker for system overview
- Auto-sudo launcher for ease of use

🎯 Key Improvements:
- Detects when optimizations exist but aren't ideal (e.g., oversized zram)
- Only prompts for optimizations that need attention
- Leaves well-configured systems alone
- Clear status reporting and user choice
- German locale support for system commands

🔧 Components Added:
- one-button-optimizer.sh: Main interactive optimizer
- quick-status-check.sh: Quick system status overview
- launcher.sh: Auto-sudo convenience launcher
- Updated README with usage instructions

Tested on 15GB RAM system with mixed optimization state.
2025-09-22 12:36:07 +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!"