summaryrefslogtreecommitdiff
path: root/ansible-supervision/recup_info_zimbra/pkg/zxsuite/zxsuite.go
blob: c42b6893cdee684ed7796bda8b07f38caa01eeba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}