DELETE mysqlclient
parent
eb229959e9
commit
b962c2fb13
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue