mirror of
https://gitlab.sectorq.eu/jaydee/omv_backup.git
synced 2025-07-01 23:58:33 +02:00
lala
This commit is contained in:
@ -13,6 +13,7 @@ import re
|
|||||||
import platform
|
import platform
|
||||||
import requests
|
import requests
|
||||||
import fnmatch
|
import fnmatch
|
||||||
|
import yaml
|
||||||
from wakeonlan import send_magic_packet
|
from wakeonlan import send_magic_packet
|
||||||
pid = os.getpid()
|
pid = os.getpid()
|
||||||
|
|
||||||
@ -298,6 +299,36 @@ if _RESTORE:
|
|||||||
ans = "y"
|
ans = "y"
|
||||||
print(cmnd)
|
print(cmnd)
|
||||||
print("Sync files")
|
print("Sync files")
|
||||||
|
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)
|
||||||
|
elif app == "homepage":
|
||||||
|
print("Stopping docker")
|
||||||
|
cmnd = f"rsync -avz --delete {BACKUP_HOST}:{BACKUP_DEVICE}{NEW_BACKUP_DIR} {SOURCE_DIR}"
|
||||||
|
ans = "y"
|
||||||
|
print(cmnd)
|
||||||
|
file = "/share/docker_data/homepage/config/widgets.yaml"
|
||||||
|
with open(file, 'r') as stream:
|
||||||
|
try:
|
||||||
|
loaded = yaml.load(stream)
|
||||||
|
except yaml.YAMLError as exc:
|
||||||
|
print(exc)
|
||||||
|
|
||||||
|
# Modify the fields from the dict
|
||||||
|
#loaded['logo']['icon'] = "/images/morefine2.png"
|
||||||
|
loaded['logo']['icon'] = "/images/qnap_nas.png"
|
||||||
|
|
||||||
|
# Save it again
|
||||||
|
with open(file, 'w') as stream:
|
||||||
|
try:
|
||||||
|
yaml.dump(loaded, stream, default_flow_style=False)
|
||||||
|
except yaml.YAMLError as exc:
|
||||||
|
print(exc)
|
||||||
|
|
||||||
if _TEST:
|
if _TEST:
|
||||||
ans = input("continue?") or "n"
|
ans = input("continue?") or "n"
|
||||||
if ans == "y" and _EXECUTE:
|
if ans == "y" and _EXECUTE:
|
||||||
|
Reference in New Issue
Block a user