so somehow this script hosed ob_state.conf?

This commit is contained in:
Marks Polakovs 2020-04-07 13:32:46 +02:00
parent 4c2fc7969f
commit e7e31c4512

View file

@ -25,7 +25,7 @@ def write_ob_status(status: bool) -> None:
if "ws" in content:
content = re.sub(file_contents_ex, "ws=" + str(1 if status else 0), content)
else:
if content[len(content) - 1] != "\n":
if len(content) > 0 and content[len(content) - 1] != "\n":
content += "\n"
content += "ws=" + str(1 if status else 0) + "\n"
fd.seek(0)