Initial Commit

This commit is contained in:
Jacky 2021-02-20 10:43:15 +08:00
commit dcc992c93d
14 changed files with 784 additions and 0 deletions

25
server/tool/nginx.go Normal file
View file

@ -0,0 +1,25 @@
package tool
import (
"bytes"
"log"
"os/exec"
"path/filepath"
)
func ReloadNginx() {
cmd := exec.Command("systemctl", "reload nginx")
var out bytes.Buffer
cmd.Stdout = &out
err := cmd.Run()
if err != nil {
log.Println(err)
}
log.Println(out.String())
}
func GetNginxConfPath(dir string) string {
return filepath.Join("/etc/nginx", dir)
}