Update vmcreate.sh

This commit is contained in:
2025-10-28 15:53:53 +00:00
parent 5246f9d710
commit 373df601ef

View File

@@ -102,7 +102,8 @@ mksnippet () {
sed -i "s|.*password.*|passwd: ${phash}|" "$snippet" || echo "sedDEBUG 2"
fi
if [ $pubkey ]; then
sed -i 's|.*ssh-rsa.*| - "$(cat ${pubkey})"|' "$snippet" || echo "sedDEBUG 3"
sshkey=$(сat "$pubkey")
sed -i "s|.*ssh-rsa.*| - ${sshkey}|" "$snippet" || echo "sedDEBUG 3"
fi
echo "Snippet $snippet created"
}