From cfcf32aba02bc2d4da3bc83a01ffc9ae3adcc2f0 Mon Sep 17 00:00:00 2001 From: Waldek Date: Mon, 4 Jan 2021 18:09:04 +0100 Subject: [PATCH] Fixed problem whth crash write file lastheard.log --- monitor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monitor.py b/monitor.py index 54e45a5..a22cf86 100644 --- a/monitor.py +++ b/monitor.py @@ -36,6 +36,7 @@ import os import csv from itertools import islice +from subprocess import check_call, CalledProcessError # Twisted modules from twisted.internet.protocol import ReconnectingClientFactory, Protocol @@ -662,6 +663,10 @@ def process_message(_bmessage): lh_logfile.write(log_lh_message + '\n') lh_logfile.close() # Lastheard in Dashboard by SP2ONG + try: + check_call("sed -i -e 's|\\x0||g' {}".format(LOG_PATH+"lastheard.log"), shell=True) + except CalledProcessError as err: + print(err) my_list=[] n=0 f = open(PATH+"templates/lastheard.html", "w")