Enhance Docker Installation and Management Commands

- Improved Docker installation process for Ubuntu systems
- Added support for dynamic Docker version detection
- Enhanced Docker local and online installation commands
- Implemented more robust Docker removal functionality
- Updated Docker installation to use system-specific package sources
- Added better error handling and logging for Docker operations
- Refined Docker service startup and configuration checks
This commit is contained in:
zeaslity
2025-02-28 17:45:12 +08:00
parent bffb643a56
commit 5c39bd7594
16 changed files with 586 additions and 86 deletions

View File

@@ -79,3 +79,11 @@ func SystemdDaemonReload() (bool, []string) {
}
return true, resultLog
}
func SystemIsRunning(serviceName string) (bool, []string) {
ok, resultLog := SingleLineCommandExecutor([]string{"systemctl", "is-active", serviceName})
if !ok {
return false, resultLog
}
return true, resultLog
}