1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00

Only add max_length line in config.php if does not exist yet

This commit is contained in:
ewilly 2017-09-23 09:32:18 +02:00
parent 812ed49fd9
commit d3eb51a6c7

View file

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