Merge pull request #20 from imolein/patch2
removed not working ssh key type detection
This commit is contained in:
18
upload.sh
18
upload.sh
@@ -56,7 +56,10 @@ if [[ -n "$PLUGIN_DELETE" && "$PLUGIN_DELETE" == "true" ]]; then
|
|||||||
expr="$expr --del"
|
expr="$expr --del"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
expr="$expr -e 'ssh -p %s -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no'"
|
home="/root"
|
||||||
|
keyfile="$home/.ssh/id"
|
||||||
|
|
||||||
|
expr="$expr -e 'ssh -i $keyfile -p %s -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no'"
|
||||||
|
|
||||||
# Include
|
# Include
|
||||||
IFS=','; read -ra INCLUDE <<< "$PLUGIN_INCLUDE"
|
IFS=','; read -ra INCLUDE <<< "$PLUGIN_INCLUDE"
|
||||||
@@ -79,24 +82,11 @@ done
|
|||||||
expr="$expr $SOURCE"
|
expr="$expr $SOURCE"
|
||||||
|
|
||||||
# Prepare SSH
|
# Prepare SSH
|
||||||
home="/root"
|
|
||||||
|
|
||||||
mkdir -p "$home/.ssh"
|
mkdir -p "$home/.ssh"
|
||||||
|
|
||||||
printf "StrictHostKeyChecking no\n" > "$home/.ssh/config"
|
printf "StrictHostKeyChecking no\n" > "$home/.ssh/config"
|
||||||
chmod 0700 "$home/.ssh/config"
|
chmod 0700 "$home/.ssh/config"
|
||||||
|
|
||||||
keyfile="$home/.ssh/id_rsa"
|
|
||||||
echo "$SSH_KEY" | grep -q "ssh-ed25519"
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
printf "Using ed25519 based key\n"
|
|
||||||
keyfile="$home/.ssh/id_ed25519"
|
|
||||||
fi
|
|
||||||
echo "$SSH_KEY" | grep -q "ecdsa-"
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
printf "Using ecdsa based key\n"
|
|
||||||
keyfile="$home/.ssh/id_ecdsa"
|
|
||||||
fi
|
|
||||||
echo "$SSH_KEY" > $keyfile
|
echo "$SSH_KEY" > $keyfile
|
||||||
chmod 0600 $keyfile
|
chmod 0600 $keyfile
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user