update http

This commit is contained in:
shoopea
2023-08-20 16:57:53 +02:00
parent b07a74543b
commit 1a1713eb14
53 changed files with 59127 additions and 75 deletions
+6 -1
View File
@@ -108,11 +108,16 @@ func (s *Ssh) Exec(cmd string) (string, error) {
}
defer session.Close()
if session.Setenv("TZ", cfg.Timezone); err != nil {
log.WithFields(log.Fields{"name": s.name, "cmd": cmd, "call": "session.Setenv", "error": err}).Errorf("")
return "", err
}
var bufout, buferr bytes.Buffer
session.Stdout = &bufout
session.Stderr = &buferr
err = session.Run("TZ=\"" + cfg.Timezone + "\" " + cmd)
err = session.Run(cmd)
if err != nil {
log.WithFields(log.Fields{"name": s.name, "cmd": cmd, "call": "session.Run", "error": err, "stderr": buferr.String()}).Errorf("")
return "", err