Caddy 2 gets a CLI! And admin endpoint is now configurable via JSON

This commit is contained in:
Matthew Holt 2019-06-28 15:39:41 -06:00
parent 006dc1792f
commit a4bdf249db
8 changed files with 374 additions and 30 deletions

15
cmd/proc_windows.go Normal file
View file

@ -0,0 +1,15 @@
package caddycmd
import (
"fmt"
"os/exec"
"strconv"
)
func gracefullyStopProcess(pid int) error {
cmd := exec.Command("taskkill", "/pid", strconv.Itoa(pid))
if err := cmd.Run(); err != nil {
return fmt.Errorf("taskkill: %v", err)
}
return nil
}