utils

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryExists

func DirectoryExists(path string) bool

DirectoryExists checks if a directory exists

func DisableService

func DisableService(serviceName string) error

DisableService disables a systemd service

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists

func IsServiceActive

func IsServiceActive(serviceName string) bool

IsServiceActive checks if a systemd service is active

func ReloadSystemd

func ReloadSystemd() error

ReloadSystemd reloads systemd daemon configuration

func RemoveDirectories

func RemoveDirectories(directories []string, logger *logrus.Logger) []error

RemoveDirectories removes multiple directories recursively, continuing on errors

func RunCleanupCommand

func RunCleanupCommand(path string) error

RunCleanupCommand removes a file or directory using rm -f, ignoring "not found" errors This is specifically designed for cleanup operations where missing files should not be treated as errors

func RunCommandWithOutput

func RunCommandWithOutput(name string, args ...string) (string, error)

RunCommandWithOutput executes a command and returns its combined output. The agent runs as root, so no sudo wrapping is needed.

func RunSystemCommand

func RunSystemCommand(name string, args ...string) error

RunSystemCommand executes a system command for privileged operations. The agent runs as root, so no sudo wrapping is needed.

func ServiceExists

func ServiceExists(serviceName string) bool

ServiceExists checks if a systemd service unit file exists

func StopService

func StopService(serviceName string) error

StopService stops a systemd service

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL