fix broken sed escaping

This commit is contained in:
Dominik Moritz Roth 2025-08-17 23:19:16 +02:00
parent 6788a6e11d
commit 5c6ddee629

View File

@ -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/