inits/cmd/dkl-system-init/signal.go

20 lines
227 B
Go
Raw Normal View History

2018-07-06 08:07:37 +00:00
package main
import (
"os"
"os/signal"
"syscall"
)
func handleSignals() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGPWR)
for sig := range c {
switch sig {
case syscall.SIGPWR:
poweroff()
}
}
}