Add docker relaunch convenience script

pull/4/head
drunkendog 2023-08-24 16:12:45 +01:00
parent 6da61a7be2
commit f70843990c
1 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,13 @@ for directory in directories:
print(replacement[0].rstrip(), replacement[1].rstrip(), int(replacement[2].rstrip().rstrip("\n")))
current_setup_template = current_setup_template.replace(replacement[0].rstrip(), replacement[1].rstrip(), int(replacement[2].rstrip().rstrip("\n")))
if replacement[0] == "#service":
with open(f"{directory}/relaunch-docker.sh", "w") as f:
f.write(f"docker pull $(docker inspect {replacement[0]} | jq -r '.[0].Config.Image')\n")
f.write(f"docker stop {replacement[0]}\n")
f.write(f"docker rm {replacement[0]}\n")
f.write(f"sh launch-docker.sh\n")
if glob.glob(f"{directory}/parser.py"):
should_continue = input(f"Custom instructions found in {directory}, continue? (Y/N) ")
if should_continue == "Y":