Fix minor issues

This commit is contained in:
Andrey Meshkov
2020-07-22 20:27:20 +03:00
parent e3ea2528be
commit 6d5d183311
5 changed files with 70 additions and 60 deletions

View File

@@ -64,7 +64,7 @@ func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
}
// Perform an update procedure to the latest available version
func handleUpdate(w http.ResponseWriter, r *http.Request) {
func handleUpdate(w http.ResponseWriter, _ *http.Request) {
if len(Context.updater.NewVersion) == 0 {
httpError(w, http.StatusBadRequest, "/update request isn't allowed now")
return

View File

@@ -226,14 +226,16 @@ func run(args options) {
}
Context.autoHosts.Init("")
Context.updater = update.NewUpdater(Context.workDir)
Context.updater.Client = Context.client
Context.updater.VersionURL = versionCheckURL
Context.updater.VersionString = versionString
Context.updater.OS = runtime.GOOS
Context.updater.Arch = runtime.GOARCH
Context.updater.ARMVersion = ARMVersion
Context.updater.ConfigName = config.getConfigFilename()
Context.updater = update.NewUpdater(update.Config{
Client: Context.client,
WorkDir: Context.workDir,
VersionURL: versionCheckURL,
VersionString: versionString,
OS: runtime.GOOS,
Arch: runtime.GOARCH,
ARMVersion: ARMVersion,
ConfigName: config.getConfigFilename(),
})
Context.clients.Init(config.Clients, Context.dhcpServer, &Context.autoHosts)
config.Clients = nil