feat: add setting for test nginx config command #191

This commit is contained in:
0xJacky 2023-11-21 15:58:53 +08:00
parent ba4aeb85ca
commit 3ee8ef0523
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
3 changed files with 13 additions and 0 deletions

View file

@ -15,6 +15,17 @@ func execShell(cmd string) (out string, err error) {
}
func TestConf() (string, error) {
if settings.NginxSettings.TestConfigCmd != "" {
out, err := execShell(settings.NginxSettings.TestConfigCmd)
if err != nil {
logger.Error(err)
return out, err
}
return out, nil
}
out, err := exec.Command("nginx", "-t").CombinedOutput()
if err != nil {
logger.Error(err)