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 88372b6da7
commit bd118e61bc
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF
2 changed files with 7 additions and 0 deletions

View file

@ -591,6 +591,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