From d3eb51a6c7c19d2d70f37854dc06b3b5d516b285 Mon Sep 17 00:00:00 2001 From: ewilly Date: Sat, 23 Sep 2017 09:32:18 +0200 Subject: [PATCH] Only add max_length line in config.php if does not exist yet --- scripts/upgrade | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3ea07e7..4898b81 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,8 +49,9 @@ myynh_clean_source cp -a "$TMPDIR/." "$final_path" rm -R "$TMPDIR" -# update config.php with 'max_length' line -case ${filesize: -1} in +# Only add 'max_length' line in config.php if does not exist yet +if [ $(grep "max_length=" "$bozon_conf" | wc -l) -eq 0 ]; then + case ${filesize: -1} in g|G) max_length=$((${filesize%?}*1024)) ;; @@ -58,7 +59,8 @@ case ${filesize: -1} in max_length=${filesize%?} ;; esac -sed -i "54i\$max_length=$max_length;" "$bozon_conf" + sed -i "54i\$max_length=$max_length;" "$bozon_conf" +fi # set permissions myynh_set_permissions