From 7d4c7b855a7c609b749d746ec5e3c1c60a9e017d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:25:30 +0100 Subject: [PATCH] Another try (copy paste from file) https://github.com/alexbelgium/hassio-addons/issues/1099#issuecomment-1833864481 --- .../rootfs/etc/cont-init.d/02-init_steps.sh | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh b/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh index f763aa705..ebc731710 100755 --- a/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh +++ b/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh @@ -145,32 +145,29 @@ if bashio::config.true "enable_thumbnails"; then sed -i "/enabledPreviewProviders/,/),/d" "$files" # Add variables - echo "'preview_ffmpeg_path' => '/usr/bin/ffmpeg', - 'enable_previews' => true, - 'enabledPreviewProviders' => - array ( - 0 => 'OC\Preview\TXT', - 1 => 'OC\Preview\MarkDown', - 2 => 'OC\Preview\OpenDocument', - 3 => 'OC\Preview\PDF', - 4 => 'OC\Preview\Image', - 5 => 'OC\Preview\TIFF', - 6 => 'OC\Preview\SVG', - 7 => 'OC\Preview\Font', - 8 => 'OC\Preview\MP3', - 9 => 'OC\Preview\Movie', - 10 => 'OC\Preview\MKV', - 11 => 'OC\Preview\MP4', - 12 => 'OC\Preview\AVI', - )," > lines_to_add + echo " 'preview_ffmpeg_path' => '/usr/bin/ffmpeg', + 'enable_previews' => true, + 'enabledPreviewProviders' => + array ( + 0 => 'OC\\Preview\\TXT', + 1 => 'OC\\Preview\\MarkDown', + 2 => 'OC\\Preview\\OpenDocument', + 3 => 'OC\\Preview\\PDF', + 4 => 'OC\\Preview\\Image', + 5 => 'OC\\Preview\\TIFF', + 6 => 'OC\\Preview\\SVG', + 7 => 'OC\\Preview\\Font', + 8 => 'OC\\Preview\\MP3', + 9 => 'OC\\Preview\\Movie', + 10 => 'OC\\Preview\\MKV', + 11 => 'OC\\Preview\\MP4', + 12 => 'OC\\Preview\\AVI', + )," > lines_to_add lines_to_add="lines_to_add" # Iterate through each line in the lines_to_add_file while IFS= read -r line; do - # Remove leading blanks - # shellcheck disable=SC2116,SC2086 - line="$(echo $line)" # Use sed to insert the line at the end in the config_file sed -i "/);/i\ \ $line" "$files" done < "$lines_to_add"