forked from toolshed/abra-hetzner
Don't send ssh_authorized_key_count, improve output
This commit is contained in:
parent
04644cb61f
commit
c126ffcf79
@ -141,20 +141,19 @@ abra_capsul() {
|
|||||||
-d "{\"name\":\"$NAME\", \
|
-d "{\"name\":\"$NAME\", \
|
||||||
\"size\": \"$SIZE\", \
|
\"size\": \"$SIZE\", \
|
||||||
\"os\": \"$OS\", \
|
\"os\": \"$OS\", \
|
||||||
\"ssh_authorized_key_count\": \"1\", \
|
|
||||||
\"ssh_key_0\": \"$SSH_KEY\" \
|
\"ssh_key_0\": \"$SSH_KEY\" \
|
||||||
}" \
|
}" \
|
||||||
"$CAPSUL_SERVER/api/capsul/create")
|
"$CAPSUL_SERVER/api/capsul/create")
|
||||||
|
|
||||||
id=$(echo "$response" | $JQ -r ".id")
|
vm_id=$(echo "$response" | $JQ -r ".id")
|
||||||
|
|
||||||
if [[ "$id" == "null" ]]; then
|
if [ "$vm_id" == "null" ] || [ -z "$vm_id" ]; then
|
||||||
error_msg=$(echo "$response" | jq -r ".errors")
|
error_msg=$(echo "$response" | jq -r ".errors")
|
||||||
echo "Oops, something went wrong. Capsul API responded with: $error_msg"
|
echo "Oops, something went wrong. Capsul API responded with: $error_msg"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "You new Capsul VPS is up, with ID $id. Enjoy!"
|
echo "You new Capsul VPS is up, with ID $vm_id. Enjoy!"
|
||||||
}
|
}
|
||||||
|
|
||||||
abra_capsul "$@"
|
abra_capsul "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user