mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-25 09:00:27 +00:00
allow to start if only httpd service is enabled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
396d67bb2c
commit
496c8bc785
2 changed files with 7 additions and 0 deletions
|
@ -592,6 +592,9 @@ func HasServicesToStart() bool {
|
|||
if globalConf.WebDAVD.ShouldBind() {
|
||||
return true
|
||||
}
|
||||
if globalConf.HTTPDConfig.ShouldBind() {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue