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:
parent
812ed49fd9
commit
d3eb51a6c7
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue