We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eec3f69 commit 5e1d958Copy full SHA for 5e1d958
.github/scripts/adhoc.sh
@@ -101,13 +101,15 @@ if [[ ${ACTION} == "deploy-metal" ]]; then
101
DEVICE_ID=$(jq -r '.id' <<< "$RESPONSE")
102
echo "Got Address ${IP_ADDRESS} and Device Id ${DEVICE_ID}"
103
popd
104
-
+
105
STATUS=0
106
for i in {1..60}; do
107
- echo "Checking the SSH is up $i"
108
- if ssh -o StrictHostKeyChecking=no ubuntu@"${IP_ADDRESS}" "echo ok" 2>/dev/null; then
109
- STATUS=1
110
- break
+ if [[ $STATUS -eq 0 ]]; then
+ [[ "$(curl -s -H "Authorization: Bearer $TOKEN" \
+ https://api.phoenixnap.com/bmc/v1/servers/$ID | jq -r '.status')" == "powered-on" ]] && STATUS=1
+ fi
111
+ if [[ $STATUS -eq 1 ]]; then
112
+ nc -z -w 2 "$IP" 22 && break
113
fi
114
sleep 5
115
done
0 commit comments