create and delete server initial setup

This commit is contained in:
Fran Jurmanović
2025-06-01 13:43:54 +02:00
parent d08695025a
commit 8a3b11b1ef
14 changed files with 929 additions and 38 deletions

View File

@@ -7,7 +7,6 @@ import (
"fmt"
"net"
"os"
"os/exec"
"reflect"
"regexp"
"strconv"
@@ -66,16 +65,6 @@ func Find[T any](lst *[]T, callback func(item *T) bool) *T {
return nil
}
func RunElevatedCommand(command string, service string) (string, error) {
cmd := exec.Command("powershell", "-nologo", "-noprofile", ".\\nssm", command, service)
// cmd := exec.Command("powershell", "-nologo", "-noprofile", "-File", "run_sc.ps1", command, service)
output, err := cmd.CombinedOutput()
if err != nil {
return "", fmt.Errorf("error: %v, output: %s", err, string(output))
}
return string(output), nil
}
func IndentJson(body []byte) ([]byte, error) {
newBody := new([]byte)
unmarshaledBody := bytes.NewBuffer(*newBody)