From 321b1a7e9cb752b98b71d2a86f1dbc026bebb964 Mon Sep 17 00:00:00 2001
From: Simon Zolin <s.zolin@adguard.com>
Date: Wed, 8 Apr 2020 19:08:35 +0300
Subject: [PATCH] Merge: - web: install: couldn't apply new HTTP port until the
 restart

Squashed commit of the following:

commit 2480dcbe2390601ab4e423241eb306127e4b6d26
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Apr 8 19:05:06 2020 +0300

    - web: install: couldn't apply new HTTP port until the restart
---
 home/control_install.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/home/control_install.go b/home/control_install.go
index e3ada191..4a39983f 100644
--- a/home/control_install.go
+++ b/home/control_install.go
@@ -345,6 +345,10 @@ func (web *Web) handleInstallConfigure(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
+	web.conf.firstRun = false
+	web.conf.BindHost = newSettings.Web.IP
+	web.conf.BindPort = newSettings.Web.Port
+
 	registerControlHandlers()
 
 	// this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block