feat(wip): self check

This commit is contained in:
Jacky 2025-01-22 16:21:33 +08:00
parent 5911462f90
commit ded74bbe0a
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
40 changed files with 1418 additions and 69 deletions

View file

@ -39,6 +39,23 @@ func GetConfPath(dir ...string) (confPath string) {
return joined
}
func GetConfEntryPath() (path string) {
if settings.NginxSettings.ConfigPath == "" {
out := getNginxV()
r, _ := regexp.Compile("--conf-path=(.*.conf)")
match := r.FindStringSubmatch(out)
if len(match) < 1 {
logger.Error("nginx.GetConfEntryPath len(match) < 1")
return ""
}
path = match[1]
} else {
path = settings.NginxSettings.ConfigPath
}
return
}
func GetPIDPath() (path string) {
if settings.NginxSettings.PIDPath == "" {
out := getNginxV()
@ -53,7 +70,7 @@ func GetPIDPath() (path string) {
path = settings.NginxSettings.PIDPath
}
return path
return
}
func GetSbinPath() (path string) {
@ -66,7 +83,7 @@ func GetSbinPath() (path string) {
}
path = match[1]
return path
return
}
func GetAccessLogPath() (path string) {
@ -83,7 +100,7 @@ func GetAccessLogPath() (path string) {
path = settings.NginxSettings.AccessLogPath
}
return path
return
}
func GetErrorLogPath() string {