diff --git a/install.sh b/install.sh index 3a01b17..70076fb 100644 --- a/install.sh +++ b/install.sh @@ -92,7 +92,9 @@ sed -i "s/^CRYPTPASSWORD .*/CRYPTPASSWORD $LUKS_PASS/" install.conf # Update post-install.sh sed -i "s/^ALMA_USER=.*/ALMA_USER=\"$USERNAME\"/" post-install.sh -sed -i "s|^SSH_KEY=.*|SSH_KEY=\"$SSH_KEY\"|" post-install.sh +# Use a different approach for SSH_KEY to handle special characters +escaped_key=$(printf '%s\n' "$SSH_KEY" | sed 's/[[\.*^$()+?{|]/\\&/g') +sed -i "s|^SSH_KEY=.*|SSH_KEY=\"$escaped_key\"|" post-install.sh # Copy to root directory where installimage expects them cp install.conf /root/