Add loop for host key lookup
parent
96f7d7bf7b
commit
253086a902
|
|
@ -59,7 +59,20 @@ fi
|
|||
# Create or append known_hosts
|
||||
|
||||
echo "Validating: $GIT_SERVER_DADI_STAGING"
|
||||
ssh-keyscan -H "$GIT_SERVER_DADI_STAGING" >>"${path_ssh}"/known_hosts
|
||||
# Wir wollen, dass der Befehl mindestens einmal erfolgreich ist.
|
||||
# Wenn er scheitert, warten wir 10 s und probieren es erneut.
|
||||
while true; do
|
||||
# Versuche, den Host‑Key zu holen und an known_hosts anzuhängen.
|
||||
# Der Rückgabewert von ssh-keyscan ist 0, wenn mindestens ein
|
||||
# Schlüssel empfangen wurde.
|
||||
if ssh-keyscan -H "$GIT_SERVER_DADI_STAGING" >>"${path_ssh}/known_hosts"; then
|
||||
echo "✅ Host key for '$GIT_SERVER_DADI_STAGING' added to known_hosts"
|
||||
break # Erfolg → Schleife verlassen
|
||||
else
|
||||
echo "⚠️ ssh-keyscan failed – retry in 10 seconds"
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
||||
echo "git and ssh configured."
|
||||
echo "|--- dadi staging webhook public key (deploy key): --------------------|"
|
||||
|
|
|
|||
Loading…
Reference in New Issue