#!/bin/bash # System Commands Handler # Handles all system subcommands by calling core functions # Safe disk reclaim: clear the whole build cache (-a; it's pure cache, always # safe to drop) and remove dangling images. Never touches volumes or in-use # images. runFileOp hits the right daemon (rootless: as the install user). reclaimDockerSpace() { isHeader "Reclaiming Space" runFileOp docker builder prune -af >/dev/null 2>&1 checkSuccess "Cleared build cache" runFileOp docker image prune -f >/dev/null 2>&1 checkSuccess "Removed dangling images" isSuccessful "Done" } cliHandleSystemCommands() { local action="$initial_command2" case "$action" in "status") tagsValidateShowSystemStatus ;; "update") checkUpdates ;; "reset") runReinstall ;; "reclaim") reclaimDockerSpace ;; *) isNotice "Invalid system command: $action" cliShowSystemHelp ;; esac }