24 lines
715 B
Python
24 lines
715 B
Python
#!/usr/bin/env python3
|
|
# V93: Filter out dead agents visually from enterprise-model.html
|
|
path = "/var/www/html/enterprise-model.html"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
if b"V93 hide dead" in raw:
|
|
print("ALREADY")
|
|
exit(0)
|
|
|
|
# Find the existing AG cleanup line we added in V91
|
|
marker = b"AG=AG.filter(function(a){return a&&a.n;});"
|
|
if marker not in raw:
|
|
print("V91 marker not found")
|
|
exit(1)
|
|
|
|
# Replace with stronger filter that also excludes rm='dead'
|
|
new = b"AG=AG.filter(function(a){return a&&a.n&&a.rm!=='dead';});/* V93 hide dead agents (was 167 invisible blocks) */"
|
|
raw = raw.replace(marker, new, 1)
|
|
|
|
with open(path, "wb") as f:
|
|
f.write(raw)
|
|
print(f"Patched size: {len(raw)}")
|