i know not a single thing about golang

also i hate tabs
This commit is contained in:
2022-02-13 17:20:00 +05:30
parent cb43219908
commit 27dd2c353e
2 changed files with 21 additions and 0 deletions

View File

@@ -68,6 +68,26 @@ func main() {
common.Check(err, "Error writing output file")
}
if ( config.Source.Restart != false ) {
cmd := exec.Command(
"nomad",
"job",
"stop",
"-purge",
"-address="+config.Source.URL,
"-token="+config.Source.Token,
config.Source.Name,
)
var out bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &out
err = cmd.Run()
if err != nil {
fmt.Fprintf(os.Stderr, "Error executing nomad: %s\n", err)
fmt.Fprint(os.Stderr, out.String())
os.Exit(1)
}
}
cmd := exec.Command(
"nomad",
"job",