mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-05-08 08:16:23 +00:00
20 lines
296 B
Go
20 lines
296 B
Go
package hook
|
|
|
|
import (
|
|
"github.com/kairos-io/kairos-sdk/utils"
|
|
"github.com/kairos-io/kairos-agent/v2/pkg/config"
|
|
)
|
|
|
|
type Lifecycle struct{}
|
|
|
|
func (s Lifecycle) Run(c config.Config) error {
|
|
if c.Install.Reboot {
|
|
utils.Reboot()
|
|
}
|
|
|
|
if c.Install.Poweroff {
|
|
utils.PowerOFF()
|
|
}
|
|
return nil
|
|
}
|