Auto restart executed commands

This commit is contained in:
Nonoo 2020-11-03 14:08:14 +01:00
parent cf79868ae1
commit 38f73f6018
5 changed files with 117 additions and 131 deletions

View file

@ -5,6 +5,7 @@ import (
"crypto/rand"
"encoding/binary"
"errors"
"fmt"
"time"
)
@ -258,9 +259,13 @@ func (s *controlStream) handleRead(r []byte) error {
s.serialAndAudioStreamOpened = true
statusLog.startPeriodicPrint()
startCmdIfNeeded()
startSerialPortCmdIfNeeded()
startRigctldCmdIfNeeded()
runCmdRunner.startIfNeeded(runCmd)
if enableSerialDevice {
serialCmdRunner.startIfNeeded(runCmdOnSerialPortCreated)
}
if !disableRigctld {
rigctldRunner.startIfNeeded(fmt.Sprint("rigctld -m ", rigctldModel, " -r :", serialTCPPort))
}
}
}
return nil