linux.go 202 B

12345678910111213
  1. // +build !windows
  2. package util
  3. import (
  4. "fmt"
  5. "io/ioutil"
  6. "os"
  7. )
  8. func CreateShutdownScript() error{
  9. return ioutil.WriteFile("shutdown.sh", []byte(fmt.Sprintf("kill -9 %d", os.Getpid())), 0777)
  10. }