Add quick recovery

pull/4/head
drunkendog 2023-08-14 23:13:31 +01:00
parent 33dd18c792
commit 15de644813
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,12 @@ parser.add_argument("domain")
parser.add_argument("email") parser.add_argument("email")
args = parser.parse_args() args = parser.parse_args()
#QUICK_RECOVER
os.makedirs(os.path.dirname("/opt/quick-recover/"), exist_ok=True)
with open("/opt/quick-recover/#service.conf", "w") as f:
f.writeline(f"export DOMAIN='{parser.domain}'")
f.writeline(f"export EMAIL='{parser.email}'")
#FILE_READ #FILE_READ
with open("../nginx-site-template.conf", "r") as f: with open("../nginx-site-template.conf", "r") as f:
template = f.read().replace("#serverNameVar", f"{args.domain}").replace("#http://127.0.0.1:8080/", f"#ip_address") template = f.read().replace("#serverNameVar", f"{args.domain}").replace("#http://127.0.0.1:8080/", f"#ip_address")