mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
bitwarden
This commit is contained in:
@@ -89,7 +89,7 @@ backups = {
|
|||||||
}
|
}
|
||||||
BACKUP_FS = "/srv/dev-disk-by-uuid-2f843500-95b6-43b0-bea1-9b67032989b8"
|
BACKUP_FS = "/srv/dev-disk-by-uuid-2f843500-95b6-43b0-bea1-9b67032989b8"
|
||||||
BACKUP_HOST = "omv.home.lan"
|
BACKUP_HOST = "omv.home.lan"
|
||||||
BACKUP_HOST = "morefine.home.lan"
|
#BACKUP_HOST = "morefine.home.lan"
|
||||||
if not host in backups:
|
if not host in backups:
|
||||||
print(f"No backup jobs for {host}")
|
print(f"No backup jobs for {host}")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
@@ -98,17 +98,20 @@ print("Test connection")
|
|||||||
hm = socket.gethostbyaddr(BACKUP_HOST)
|
hm = socket.gethostbyaddr(BACKUP_HOST)
|
||||||
|
|
||||||
hostdown = True
|
hostdown = True
|
||||||
|
n=0
|
||||||
while hostdown:
|
while hostdown:
|
||||||
#HOST_UP = os.system(f"ping -c 1 -w 2 omv.home.lan") == 0
|
#HOST_UP = os.system(f"ping -c 1 -w 2 omv.home.lan") == 0
|
||||||
cmnd = f"ping -c 1 -w 2 {BACKUP_HOST}"
|
cmnd = f"ping -c 1 -w 2 {BACKUP_HOST}"
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
print(status)
|
# print(status)
|
||||||
print(output)
|
# print(output)
|
||||||
|
|
||||||
|
|
||||||
if status != 0:
|
if status != 0:
|
||||||
send_magic_packet('88:c9:b3:b5:23:d8')
|
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)
|
time.sleep(5)
|
||||||
|
n += 1
|
||||||
else:
|
else:
|
||||||
print("host up")
|
print("host up")
|
||||||
hostdown = False
|
hostdown = False
|
||||||
|
|||||||
Reference in New Issue
Block a user