mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-22 07:30:25 +00:00
3603493146
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
21 lines
357 B
Go
21 lines
357 B
Go
package service
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
|
|
"github.com/drakkan/sftpgo/v2/logger"
|
|
"github.com/drakkan/sftpgo/v2/plugin"
|
|
)
|
|
|
|
func registerSignals() {
|
|
c := make(chan os.Signal, 1)
|
|
signal.Notify(c, os.Interrupt)
|
|
go func() {
|
|
for range c {
|
|
logger.Debug(logSender, "", "Received interrupt request")
|
|
plugin.Handler.Cleanup()
|
|
os.Exit(0)
|
|
}
|
|
}()
|
|
}
|