Fix lnbits status color

This commit is contained in:
Taylor Helsper 2021-03-02 20:06:53 -06:00
parent 982dd407d5
commit b040bff158

View File

@ -546,9 +546,9 @@ def get_lnbits_status_and_color():
if is_lnbits_enabled():
status_code = get_service_status_code("lnbits")
if status_code != 0:
lnbits_status_color = "red"
color = "red"
else:
lnbits_status_color = "green"
color = "green"
else:
status = "Waiting on LND..."
return status,color
@ -876,6 +876,26 @@ def has_sd_rw_error():
return os.path.isfile("/tmp/sd_rw_error")
#==================================
# Out of Memory Error Functions
#==================================
def has_oom_error():
return os.path.isfile("/tmp/oom_error")
def clear_oom_error():
os.system("rm -f /tmp/oom_error")
os.system("rm -f /tmp/oom_info")
def set_oom_error(oom_error):
os.system("touch /tmp/oom_error")
set_file_contents("/tmp/oom_info", oom_error)
def get_oom_error_info():
try:
with open("/tmp/oom_info", "r") as f:
return f.read()
except:
return "ERROR"
return "ERROR"
#==================================
# Docker Functions
#==================================