extensions/fs-cryptroot-support.sh: fix #6857

rework quoting for sed expression manipulating DROPBEAR_OPTIONS in dropbear.conf
This commit is contained in:
Alessandro Lannocca
2024-07-01 22:00:00 +01:00
committed by Igor
parent 30992cfaaf
commit 970048441a

View File

@@ -47,7 +47,7 @@ function pre_install_kernel_debs__adjust_dropbear_configuration() {
# Set the port of the dropbear ssh daemon in the initramfs to a different one if configured
# this avoids the typical 'host key changed warning' - `WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!`
[[ -f "${dropbear_dir}/${dropbear_config}" ]] &&
sed -i 's/^#DROPBEAR_OPTIONS=/DROPBEAR_OPTIONS="-j -k -p '"${CRYPTROOT_SSH_UNLOCK_PORT}"' -s -c cryptroot-unlock"/' \
sed -i "s/^#DROPBEAR_OPTIONS=.*/DROPBEAR_OPTIONS=\"-j -k -p "${CRYPTROOT_SSH_UNLOCK_PORT}" -s -c cryptroot-unlock\"/" \
"${dropbear_dir}/${dropbear_config}"
# setup dropbear authorized_keys, either provided by userpatches or generated