Inital commit

This commit is contained in:
2026-06-24 13:44:39 -04:00
commit f098d5f170
15 changed files with 471 additions and 0 deletions

28
server/status.go Normal file
View File

@@ -0,0 +1,28 @@
package server
import (
"bytes"
"fmt"
"log"
"os/exec"
"github.com/spf13/cobra"
)
func Status(cmd *cobra.Command, args []string) {
dir := args[0]
name := getServerName(dir)
start_cmd := exec.Command("docker", "exec", name, "rcon-cli", "list")
var outb, errb bytes.Buffer
start_cmd.Stdout = &outb
start_cmd.Stderr = &errb
if err := start_cmd.Run(); err != nil {
log.Fatal(err)
}
fmt.Println(outb.String())
}