main.py aktualisiert
This commit is contained in:
8
main.py
8
main.py
@@ -100,6 +100,14 @@ async def remove_node(node_id: int):
|
||||
conn.close()
|
||||
return RedirectResponse(url="/", status_code=303)
|
||||
|
||||
async def check_docker_installed(ip, user):
|
||||
# Prüft via SSH, ob der Befehl 'docker' existiert
|
||||
cmd = "command -v docker >/dev/null 2>&1 && echo 'yes' || echo 'no'"
|
||||
ssh_cmd = f"ssh -o StrictHostKeyChecking=no {user}@{ip} '{cmd}'"
|
||||
process = subprocess.Popen(ssh_cmd, shell=True, stdout=subprocess.PIPE, text=True)
|
||||
output = process.stdout.read().strip()
|
||||
return output == "yes"
|
||||
|
||||
# --- Chat & KI Logik ---
|
||||
|
||||
@app.websocket("/ws/chat")
|
||||
|
||||
Reference in New Issue
Block a user