standard-build/scripts/recover-service.py

15 lines
534 B
Python
Raw Normal View History

2023-08-15 02:07:48 +01:00
import sys
import glob
import os
directories = sys.argv[1:]
for directory in directories:
if not glob.glob(f"{directory}/manifest.dat"):
raise FileNotFoundError
with open(f"{directory}/manifest.dat", "r") as f:
manifest_info = [line_info.split("\n@ ")[1:] for line_info in f.read().split("%")[1:]]
for replacement in manifest_info:
if replacement[0] == "#service":
os.system(f". /opt/quick-recover/{replacement[1]}.conf; python3 {directory}/setup.py $DOMAIN $EMAIL")
2023-08-15 02:08:30 +01:00
break