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,7 +49,8 @@ myynh_clean_source
cp -a "$TMPDIR/." "$final_path" cp -a "$TMPDIR/." "$final_path"
rm -R "$TMPDIR" rm -R "$TMPDIR"
# update config.php with 'max_length' line # 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 case ${filesize: -1} in
g|G) g|G)
max_length=$((${filesize%?}*1024)) max_length=$((${filesize%?}*1024))
@ -59,6 +60,7 @@ case ${filesize: -1} in
;; ;;
esac esac
sed -i "54i\$max_length=$max_length;" "$bozon_conf" sed -i "54i\$max_length=$max_length;" "$bozon_conf"
fi
# set permissions # set permissions
myynh_set_permissions myynh_set_permissions