mirror of
https://github.com/ShaYmez/HBmonitor.git
synced 2024-11-21 23:45:17 -05:00
Fixed problem whth crash write file lastheard.log
This commit is contained in:
parent
7c86d47a30
commit
ffeae482fb
@ -35,6 +35,7 @@ import datetime
|
|||||||
import os
|
import os
|
||||||
import csv
|
import csv
|
||||||
from itertools import islice
|
from itertools import islice
|
||||||
|
from subprocess import check_call, CalledProcessError
|
||||||
|
|
||||||
# Twisted modules
|
# Twisted modules
|
||||||
from twisted.internet.protocol import ReconnectingClientFactory, Protocol
|
from twisted.internet.protocol import ReconnectingClientFactory, Protocol
|
||||||
@ -632,6 +633,10 @@ def process_message(_bmessage):
|
|||||||
lh_logfile = open(LOG_PATH+"lastheard.log", "a")
|
lh_logfile = open(LOG_PATH+"lastheard.log", "a")
|
||||||
lh_logfile.write(log_lh_message + '\n')
|
lh_logfile.write(log_lh_message + '\n')
|
||||||
lh_logfile.close()
|
lh_logfile.close()
|
||||||
|
try:
|
||||||
|
check_call("sed -i -e 's|\\x0||g' {}".format(LOG_PATH+"lastheard.log"), shell=True)
|
||||||
|
except CalledProcessError as err:
|
||||||
|
print(err)
|
||||||
# Lastheard in Dashboard by SP2ONG
|
# Lastheard in Dashboard by SP2ONG
|
||||||
my_list=[]
|
my_list=[]
|
||||||
n=0
|
n=0
|
||||||
|
Loading…
Reference in New Issue
Block a user