Compare commits

...

17 Commits

Author SHA1 Message Date
b6b2259a78 lala 2025-03-03 15:24:06 +01:00
f2ae0b14bd lala 2025-03-03 15:23:38 +01:00
535297a8f7 lala 2025-03-03 15:20:08 +01:00
81e08f7893 lala 2025-03-03 15:19:27 +01:00
3232bf9220 lala 2025-03-03 15:18:55 +01:00
36017a6e9a lala 2025-03-03 15:15:55 +01:00
47babb6080 lala 2025-03-03 15:14:49 +01:00
85cf2122b1 lala 2025-03-03 15:13:06 +01:00
1c3468f742 lala 2025-03-03 15:11:47 +01:00
22fdeab1d2 lala 2025-03-03 15:10:53 +01:00
f304b908be lala 2025-03-03 15:09:22 +01:00
f45d719e17 lala 2025-03-03 15:08:46 +01:00
17e5029080 lala 2025-03-03 15:08:22 +01:00
06480eb226 lala 2025-03-03 15:07:43 +01:00
1d6448813d lala 2025-03-03 15:07:05 +01:00
da38d219c1 lala 2025-03-03 15:06:26 +01:00
9276a3f776 lala 2025-03-03 14:58:58 +01:00
2 changed files with 47 additions and 1 deletions

View File

@ -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()
@ -302,6 +303,50 @@ if _RESTORE:
ans = input("continue?") or "n" ans = input("continue?") or "n"
if ans == "y" and _EXECUTE: if ans == "y" and _EXECUTE:
status, output = subprocess.getstatusoutput(cmnd) 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)
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:
loaded = yaml.load(stream, Loader=yaml.FullLoader)
except yaml.YAMLError as exc:
print(exc)
# Modify the fields from the dict
#loaded['logo']['icon'] = "/images/morefine2.png"
print(json.dumps(loaded, indent=2))
i = 0
for y in loaded:
print(i)
print(y)
if "logo" in y:
loaded[i]['logo']['icon'] = "/images/qnap_nas.png"
i+=1
# Save it again
print(f"writing to file {file}")
with open(file, 'w') as stream:
try:
yaml.dump(loaded, stream, default_flow_style=False)
except yaml.YAMLError as exc:
print("failed")
print(exc)
print("Start docker") print("Start docker")
# cmnd = "docker start heimdall" # cmnd = "docker start heimdall"
# status, output = subprocess.getstatusoutput(cmnd) # status, output = subprocess.getstatusoutput(cmnd)

View File

@ -3,4 +3,5 @@ requests
getmac getmac
paho-mqtt paho-mqtt
autorandr autorandr
wakeonlan wakeonlan
pyyaml