Files
cloudsave/cmd/server/main.go
Aurélie DELHAIE 0a33d1b68d
All checks were successful
CloudSave/pipeline/head This commit looks good
wip 0.0.5
2025-09-02 22:32:07 +02:00

38 lines
483 B
Go

//go:build !windows
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
const defaultDocumentRoot string = "/var/lib/cloudsave"
var (
updateChan chan struct{}
)
func main() {
updateChan = make(chan struct{})
sigc := make(chan os.Signal, 1)
signal.Notify(sigc, syscall.SIGHUP)
go func() {
for {
<-sigc
updateChan <- struct{}{}
}
}()
run(updateChan)
}
func fatal(message string, exitCode int) {
fmt.Fprintln(os.Stderr, message)
os.Exit(exitCode)
}