mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
bitwarden
This commit is contained in:
@@ -88,17 +88,19 @@ 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 = "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()
|
||||||
print("Test connection")
|
print("Test connection")
|
||||||
|
|
||||||
hm = socket.gethostbyaddr("omv.home.lan")
|
hm = socket.gethostbyaddr(BACKUP_HOST)
|
||||||
|
|
||||||
hostdown = True
|
hostdown = True
|
||||||
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 = "ping -c 1 -w 2 omv.home.lan"
|
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)
|
||||||
@@ -110,13 +112,12 @@ while hostdown:
|
|||||||
else:
|
else:
|
||||||
print("host up")
|
print("host up")
|
||||||
hostdown = False
|
hostdown = False
|
||||||
host = "omv.home.lan"
|
|
||||||
host = "morefine.home.lan"
|
|
||||||
port = 22 # Replace with the port you want to test
|
port = 22 # Replace with the port you want to test
|
||||||
if is_port_open(host, port):
|
if is_port_open(BACKUP_HOST, port):
|
||||||
print(f"Port {port} on {host} is open.")
|
print(f"Port {port} on {BACKUP_HOST} is open.")
|
||||||
else:
|
else:
|
||||||
print(f"Port {port} on {host} is closed.")
|
print(f"Port {port} on {BACKUP_HOST} is closed.")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user