mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-18 21:38:58 +00:00
asdf
This commit is contained in:
@@ -4,11 +4,23 @@ set -e
|
|||||||
# Validate SSH private key
|
# Validate SSH private key
|
||||||
if [ -n "$KEY" ]; then
|
if [ -n "$KEY" ]; then
|
||||||
echo "Validating SSH private key..."
|
echo "Validating SSH private key..."
|
||||||
echo "$KEY" | ssh-keygen -y -f -
|
|
||||||
|
# Create .ssh directory if it doesn't exist
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
|
||||||
|
# Write key to file
|
||||||
|
echo "$KEY" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
cat ~/.ssh/id_rsa
|
||||||
|
|
||||||
|
# Validate the key
|
||||||
|
ssh-keygen -y -f ~/.ssh/id_rsa
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "✓ SSH private key is valid"
|
echo "✓ SSH private key is valid"
|
||||||
else
|
else
|
||||||
echo "✗ SSH private key is invalid"
|
echo "✗ SSH private key is invalid"
|
||||||
|
rm -f ~/.ssh/id_rsa
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user