"net/http"
"net/url"
"os"
+ "os/signal"
"path/filepath"
"regexp"
"runtime"
"strings"
+ "syscall"
)
const (
}
refreshPasswd()
log.Println("root:", *root, "bind:", *bind)
+ needsRefreshPasswd := make(chan os.Signal, 0)
+ signal.Notify(needsRefreshPasswd, syscall.SIGHUP)
+ go func() {
+ for range needsRefreshPasswd {
+ refreshPasswd()
+ }
+ }()
http.HandleFunc(*norefreshURLPath, handler)
http.HandleFunc(*refreshURLPath, handler)
log.Fatal(http.ListenAndServe(*bind, nil))