mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
Initial Commit
This commit is contained in:
commit
dcc992c93d
14 changed files with 784 additions and 0 deletions
25
server/tool/nginx.go
Normal file
25
server/tool/nginx.go
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue