This commit is contained in:
2025-03-03 15:14:49 +01:00
parent 85cf2122b1
commit 47babb6080

View File

@ -311,6 +311,12 @@ if _RESTORE:
cmnd = f"rsync -avz --delete {BACKUP_HOST}:{BACKUP_DEVICE}{NEW_BACKUP_DIR} {SOURCE_DIR}"
ans = "y"
print(cmnd)
if _TEST:
ans = input("continue?") or "n"
if ans == "y" and _EXECUTE:
status, output = subprocess.getstatusoutput(cmnd)
file = "/share/docker_data/homepage/config/widgets.yaml"
with open(file, 'r') as stream:
try:
@ -325,17 +331,15 @@ if _RESTORE:
# Save it again
print(f"writing to file {file}")
with open("/tmp/lala", 'w') as stream:
with open(file, 'w') as stream:
try:
yaml.dump(loaded, stream, default_flow_style=False)
except yaml.YAMLError as exc:
print("failed")
print(exc)
if _TEST:
ans = input("continue?") or "n"
if ans == "y" and _EXECUTE:
status, output = subprocess.getstatusoutput(cmnd)
print("Start docker")
# cmnd = "docker start heimdall"
# status, output = subprocess.getstatusoutput(cmnd)