Files
wol-sol-agent/system/shutdown_windows.go
2025-11-11 20:38:49 +01:00

26 lines
491 B
Go

//go:build windows
// +build windows
package system
import (
"os/exec"
"git.secnex.io/secnex/masterlog"
)
// Shutdown shuts down the system (Windows)
func Shutdown() {
cmd := exec.Command("shutdown", "/s", "/t", "0")
if err := cmd.Run(); err != nil {
masterlog.Error("Failed to shutdown system", map[string]interface{}{
"error": err,
"note": "The application may need administrator privileges",
})
return
}
masterlog.Info("Shutdown command executed successfully")
}