Add 'scripts/recover-service.py'

pull/4/head
drunkendog 2023-08-15 02:07:48 +01:00
parent 15de644813
commit 2d4fc83f80
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
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")