inits/cmd/dkl-system-init/signal.go
2018-07-06 19:07:37 +11:00

20 lines
227 B
Go

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()
}
}
}