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

31
server/shell.go Normal file
View File

@@ -0,0 +1,31 @@
package server
import (
"log"
"os/exec"
"strings"
"github.com/spf13/cobra"
)
func Shell(cmd *cobra.Command, args []string) {
dir := args[0]
name := getServerName(dir)
start_cmd := exec.Command("docker", "exec", name, "rcon-cli")
if err := start_cmd.Run(); err != nil {
log.Fatal(err)
}
}
func Say(cmd *cobra.Command, args []string) {
dir := args[0]
name := getServerName(dir)
start_cmd := exec.Command("docker", "exec", name, "rcon-cli", strings.Join(args[1:], " "))
if err := start_cmd.Run(); err != nil {
log.Fatal(err)
}
}