allow to start if only httpd service is enabled

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2023-01-17 18:22:04 +01:00
parent 396d67bb2c
commit 496c8bc785
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF
2 changed files with 7 additions and 0 deletions

View file

@ -592,6 +592,9 @@ func HasServicesToStart() bool {
if globalConf.WebDAVD.ShouldBind() {
return true
}
if globalConf.HTTPDConfig.ShouldBind() {
return true
}
return false
}

View file

@ -386,6 +386,10 @@ func TestServiceToStart(t *testing.T) {
sftpdConf := config.GetSFTPDConfig()
sftpdConf.Bindings[0].Port = 0
config.SetSFTPDConfig(sftpdConf)
// httpd service is enabled
assert.True(t, config.HasServicesToStart())
httpdConf := config.GetHTTPDConfig()
httpdConf.Bindings[0].Port = 0
assert.False(t, config.HasServicesToStart())
ftpdConf := config.GetFTPDConfig()
ftpdConf.Bindings[0].Port = 2121