DELETE mysqlclient

main
Sebastian Serfling 2023-08-01 09:53:58 +02:00
parent eb229959e9
commit b962c2fb13
1 changed files with 6 additions and 7 deletions

View File

@ -6,15 +6,14 @@ import os
def ping(host): def ping(host):
# Führe den Ping-Befehl aus und erfasse die Ausgabe # Führe den Ping-Befehl aus und erfasse die Ausgabe
result = os.system("ping -c 1 " + host) result = os.system("ping -c 1 " + host)
return result if result == 0:
hostname = "172.17.1.21", 22
if ping("172.17.1.21") == 0:
hostname = "172.17.1.21, 22"
else: else:
hostname = "forward.stines.de, 2223" hostname = "forward.stines.de", 2223
return hostname
server = SSHTunnelForwarder( server = SSHTunnelForwarder(
(hostname), (ping("172.17.1.21")),
ssh_username="root", ssh_username="root",
ssh_password="adm.3dfx12", ssh_password="adm.3dfx12",
remote_bind_address=('127.0.0.1', 3306) remote_bind_address=('127.0.0.1', 3306)