Added Status

This commit is contained in:
2022-05-24 16:20:53 -05:00
parent 8217f83e67
commit 14a042ce8c
3 changed files with 21 additions and 2 deletions

View File

@@ -120,3 +120,21 @@ func configure(c *gin.Context) {
check(err)
c.Data(http.StatusOK, "text/html", updated_page)
}
func isRunning(c *gin.Context) {
cmd := exec.Command("ps", "aux")
var out bytes.Buffer
cmd.Stdout = &out
err := cmd.Run()
check(err)
haystack := out.String()
var ret string
if strings.Contains(haystack, "VRisingServer.exe") {
ret = "true"
} else {
ret = "false"
}
c.String(http.StatusOK, ret, nil)
}