bitwarden

This commit is contained in:
jaydee
2024-11-29 12:18:12 +01:00
parent 58acdfe702
commit 24b34a3b00

View File

@@ -89,7 +89,7 @@ backups = {
}
BACKUP_FS = "/srv/dev-disk-by-uuid-2f843500-95b6-43b0-bea1-9b67032989b8"
BACKUP_HOST = "omv.home.lan"
BACKUP_HOST = "morefine.home.lan"
#BACKUP_HOST = "morefine.home.lan"
if not host in backups:
print(f"No backup jobs for {host}")
sys.exit()
@@ -98,17 +98,20 @@ print("Test connection")
hm = socket.gethostbyaddr(BACKUP_HOST)
hostdown = True
n=0
while hostdown:
#HOST_UP = os.system(f"ping -c 1 -w 2 omv.home.lan") == 0
cmnd = f"ping -c 1 -w 2 {BACKUP_HOST}"
status, output = subprocess.getstatusoutput(cmnd)
print(status)
print(output)
# print(status)
# print(output)
if status != 0:
send_magic_packet('88:c9:b3:b5:23:d8')
print("Backup host down, waiting")
print(f"Backup host down, waiting - {n}\r", end="")
time.sleep(5)
n += 1
else:
print("host up")
hostdown = False