added more sanity checks + restructured code a bit

This commit is contained in:
Bernhard B
2021-09-11 23:03:01 +02:00
parent 79fa00fdf1
commit 2a0347eea2
5 changed files with 67 additions and 30 deletions

View File

@@ -68,7 +68,6 @@ func main() {
supervisorctlConfigFilename := "/etc/supervisor/conf.d/" + "signal-cli-json-rpc-" + strconv.FormatInt(ctr, 10) + ".conf"
supervisorctlConfig := fmt.Sprintf(supervisorctlConfigTemplate, supervisorctlProgramName, supervisorctlProgramName,
tcpPort, fifoPathname, filename, fifoPathname, supervisorctlProgramName, supervisorctlProgramName)
log.Info(supervisorctlConfig)
err = ioutil.WriteFile(supervisorctlConfigFilename, []byte(supervisorctlConfig), 0644)
if err != nil {
log.Fatal("Couldn't write ", supervisorctlConfigFilename, ": ", err.Error())