diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go index c839a876..a9b7302b 100644 --- a/web/job/check_client_ip_job.go +++ b/web/job/check_client_ip_job.go @@ -40,17 +40,19 @@ func (j *CheckClientIpJob) Run() { f2bInstalled := j.checkFail2BanInstalled() isAccessLogAvailable := j.checkAccessLogAvailable(iplimitActive) - if iplimitActive { + if isAccessLogAvailable { if runtime.GOOS == "windows" { - if isAccessLogAvailable { + if iplimitActive { shouldClearAccessLog = j.processLogFile() } } else { - if f2bInstalled && isAccessLogAvailable { - shouldClearAccessLog = j.processLogFile() - } else { - if !f2bInstalled { - logger.Warning("[LimitIP] Fail2Ban is not installed, Please install Fail2Ban from the x-ui bash menu.") + if iplimitActive { + if f2bInstalled { + shouldClearAccessLog = j.processLogFile() + } else { + if !f2bInstalled { + logger.Warning("[LimitIP] Fail2Ban is not installed, Please install Fail2Ban from the x-ui bash menu.") + } } } }