Files
vps-management-bot/tmp/fix-nezha-clean.py
2026-03-21 01:10:53 +08:00

17 lines
385 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import yaml
lines = []
with open("/tmp/nezha-config-raw.yaml") as f:
for line in f:
if not line.startswith("custom_code"):
lines.append(line)
config = yaml.safe_load("".join(lines))
# 不加 custom_code恢复默认
with open("/tmp/nezha-config-fixed.yaml", "w") as f:
yaml.dump(config, f, allow_unicode=True, default_flow_style=False)
print("done")