mirror of
https://github.com/langhuihui/monibuca.git
synced 2026-05-08 19:21:09 +08:00
cbe9f2d645
feature:auto init shutdown.sh or shutdown.bat when program start
15 lines
237 B
Go
15 lines
237 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package util
|
|
|
|
import (
|
|
"fmt"
|
|
"io/ioutil"
|
|
"os"
|
|
)
|
|
|
|
func CreateShutdownScript() error {
|
|
return ioutil.WriteFile("shutdown.bat", []byte(fmt.Sprintf("taskkill /pid %d -t -f", os.Getpid())), 0777)
|
|
}
|