refactor: consolidate property fetching for nginx plugin into golang codebase
Also update the documentation to include docs for all properties.
This commit is contained in:
1 parent
6625846ecc
commit
d4b445985b
14 files changed
+1448
-492
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package nginxvhosts
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func getLogRoot() string {
|
||||
logRoot := "/var/log/nginx"
|
||||
if isOpenRestyInstalled() {
|
||||
logRoot = "/var/log/openresty"
|
||||
}
|
||||
return logRoot
|
||||
}
|
||||
|
||||
func isOpenRestyInstalled() bool {
|
||||
fi, err := os.Stat("/usr/bin/openresty")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if fi.IsDir() {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in new issue
Block a user