[updates] (Linux): custom post-upgrade commands + command to restore SELinux context
This commit is contained in:
@@ -51,6 +51,22 @@ var (
|
||||
ErrActionRequired = errors.New("action required")
|
||||
)
|
||||
|
||||
// UpdateCommandConfig defines the configuration for a shell command
|
||||
// that is executed when an update is applied
|
||||
type UpdateCommandConfig struct {
|
||||
// Shell command to execute
|
||||
Command string
|
||||
// Arguments to pass to the command
|
||||
Args []string
|
||||
// Execute triggers: if not empty, the command will be executed only if specified file was updated
|
||||
// if empty, the command will be executed always
|
||||
TriggerArtifactFName string
|
||||
// FailOnError defines whether the upgrade should fail if the command fails
|
||||
// true - upgrade will fail if the command fails
|
||||
// false - upgrade will continue even if the command fails
|
||||
FailOnError bool
|
||||
}
|
||||
|
||||
// Config holds the configuration for the updates module.
|
||||
type Config struct {
|
||||
// Name of the updater.
|
||||
@@ -88,6 +104,9 @@ type Config struct {
|
||||
// Notify defines whether the user shall be informed about events via notifications.
|
||||
// If enabled, disables automatic restart after upgrade.
|
||||
Notify bool
|
||||
|
||||
// list of shell commands needed to run after the upgrade (if any)
|
||||
PostUpgradeCommands []UpdateCommandConfig
|
||||
}
|
||||
|
||||
// Check looks for obvious configuration errors.
|
||||
|
||||
Reference in New Issue
Block a user