Compare commits
5 Commits
3957c8f617
...
21e3f1fc24
| Author | SHA1 | Date |
|---|---|---|
|
|
21e3f1fc24 | |
|
|
daa3eeb2a0 | |
|
|
72bbffede2 | |
|
|
bf71600bec | |
|
|
938cdb45a3 |
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
wget -4 -O /usr/local/bin/borg-linux64 $(curl -s https://api.github.com/repos/borgbackup/borg/releases/latest| jq -r '.assets | .[] | select(.name == "borg-linux64") | .browser_download_url')
|
||||||
|
chmod -v +x /usr/local/bin/borg-linux64
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
cd "${0%/*}"
|
||||||
|
|
||||||
|
cd scripts
|
||||||
|
python3 setup-generator.py
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
systemctl stop nginx
|
systemctl stop nginx
|
||||||
certbot certonly -n --standalone --agree-tos -d $1 -m $2
|
certbot certonly -n --standalone --agree-tos -d $1 -m $2
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
import glob, importlib, sys
|
import glob
|
||||||
|
import importlib
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
with open("setup-template.py", "r") as f:
|
with open("setup-template.py", "r") as f:
|
||||||
setup_template = f.read()
|
setup_template = f.read()
|
||||||
|
|
@ -9,6 +12,9 @@ if len(sys.argv) >= 2:
|
||||||
directories = sys.argv[1:]
|
directories = sys.argv[1:]
|
||||||
|
|
||||||
for directory in directories:
|
for directory in directories:
|
||||||
|
if ".." in directory:
|
||||||
|
raise OSError("Illegal directory path")
|
||||||
|
|
||||||
if not glob.glob(f"{directory}/manifest.dat"):
|
if not glob.glob(f"{directory}/manifest.dat"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -26,10 +32,13 @@ for directory in directories:
|
||||||
|
|
||||||
if replacement[0] == "#service":
|
if replacement[0] == "#service":
|
||||||
with open(f"{directory}/relaunch-docker.sh", "w") as f:
|
with open(f"{directory}/relaunch-docker.sh", "w") as f:
|
||||||
f.write(f"docker pull $(docker inspect {replacement[1]} | jq -r '.[0].Config.Image')\n")
|
f.write("#!/bin/sh\n")
|
||||||
f.write(f"docker stop {replacement[1]}\n")
|
f.write("cd \"${0%/*}\"\n")
|
||||||
f.write(f"docker rm {replacement[1]}\n")
|
f.write(f"docker pull $(docker inspect {replacement[1].strip()} | jq -r '.[0].Config.Image')\n")
|
||||||
|
f.write(f"docker stop {replacement[1].strip()}\n")
|
||||||
|
f.write(f"docker rm {replacement[1].strip()}\n")
|
||||||
f.write(f"sh launch-docker.sh\n")
|
f.write(f"sh launch-docker.sh\n")
|
||||||
|
subprocess.run(["chmod", "+x", f"{directory}/relaunch-docker.sh"])
|
||||||
|
|
||||||
if glob.glob(f"{directory}/parser.py"):
|
if glob.glob(f"{directory}/parser.py"):
|
||||||
should_continue = input(f"Custom instructions found in {directory}, continue? (Y/N) ")
|
should_continue = input(f"Custom instructions found in {directory}, continue? (Y/N) ")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue