release: v0.2.0
Some checks failed
Release / Build & Release (push) Has been cancelled
Some checks failed
Release / Build & Release (push) Has been cancelled
Comprehensive release containing structural, UX, and behavioral upgrades since v0.1.0: 1. Namespace Transition: Renamed core executable and project namespaces from 'smart-monitor' to 'smart-shutdown'. 2. Objective Vocabulary Refactoring: Normalized output strings and logging descriptors system-wide to a strict, professional tone. 3. Advanced Status Query: 'status' subcommand now retrieves the parsed configuration, log locations/sizes, and tails the last 10 lines of the local log file. 4. Runtime Configuration Setter: Introduced 'config set' subcommand to modify the configuration file with strict type validations. 5. Auto-System Deployment: Remapped 'install' to clone the executable into system domains and register global PATH variables. 6. Cleaner Removal: 'uninstall' purges binary clones and clears environmental variables, leaving zero traces. 7. Documentation Rewrite: Generated an objective README file featuring copy-paste ready Markdown blocks.
This commit is contained in:
@@ -6,11 +6,9 @@ import (
|
||||
"smart-shutdown/pkg/logger"
|
||||
)
|
||||
|
||||
// ExecuteShutdown 跨平台执行立即无条件关机
|
||||
func ExecuteShutdown() error {
|
||||
logger.Crit("执行系统关机操作!")
|
||||
logger.Crit("系统调用:执行关机指令")
|
||||
|
||||
// 注意:在实际正式环境使用前,如果想防误触可暂时注释掉下方的 `cmd.Run()`
|
||||
var cmd *exec.Cmd
|
||||
if runtime.GOOS == "windows" {
|
||||
cmd = exec.Command("shutdown", "-s", "-f", "-t", "0")
|
||||
|
||||
Reference in New Issue
Block a user