package zxsuite

import (
	"log"
	"os/exec"
)

func CmdZxSuite(module string, cmd string) ([]byte, error) {
	outputZx, err := exec.Command("sudo", "-u", "zimbra", "/opt/zimbra/bin/zxsuite", "--json", module, cmd).Output()
	if err != nil {
		log.Fatal(err)
	}
	return outputZx, nil
}

func CmdZmcontrol(cmd string) ([]byte, error) {
	outputZmcontrol, err := exec.Command("sudo", "-u", "zimbra", "/opt/zimbra/bin/zmcontrol", cmd).Output()
	if err != nil {
		log.Fatal(err)
	}
	return outputZmcontrol, nil
}
