mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-21 16:44:27 +01:00
remove any existing named pipe before creating a new one
This commit is contained in:
@@ -49,6 +49,9 @@ func main() {
|
|||||||
tcpPort := tcpBasePort + ctr
|
tcpPort := tcpBasePort + ctr
|
||||||
jsonRpc2ClientConfig.AddEntry(number, utils.ConfigEntry{TcpPort: tcpPort, FifoPathname: fifoPathname})
|
jsonRpc2ClientConfig.AddEntry(number, utils.ConfigEntry{TcpPort: tcpPort, FifoPathname: fifoPathname})
|
||||||
ctr += 1
|
ctr += 1
|
||||||
|
|
||||||
|
os.Remove(fifoPathname) //remove any existing named pipe
|
||||||
|
|
||||||
_, err = exec.Command("mkfifo", fifoPathname).Output()
|
_, err = exec.Command("mkfifo", fifoPathname).Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Couldn't create fifo with name ", fifoPathname, ": ", err.Error())
|
log.Fatal("Couldn't create fifo with name ", fifoPathname, ": ", err.Error())
|
||||||
|
|||||||
Reference in New Issue
Block a user