mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 02:34:53 +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_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
|
||||
|
||||
Reference in New Issue
Block a user