1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/paheko_ynh.git synced 2024-09-03 19:56:22 +02:00

cleaning code upgrade

This commit is contained in:
Robles Rodolphe 2023-09-16 09:52:34 +02:00 committed by GitHub
parent 218805413f
commit c8d6fbdbe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,11 +30,11 @@ if [[ -z "${secret_key:-}" ]]; then
fi
#=================================================
# BACKUP SQLITE DATABASE
# BACKUP SQLITE DATABASE AND DATAS
#=================================================
ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5
# copy data directory bacckup
# copy data directory backup
cp -a $install_dir/data /tmp/data
#=================================================
@ -84,9 +84,19 @@ fi
ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php"
ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php"
#=================================================
# RESTORE BACKUP SQLITE DATABASE AND DATAS
#=================================================
ynh_script_progression --message="Restore datas..." --weight=5
# Sync data directory backup
rsync -R /tmp/data/ $install_dir/data/
#=================================================
# FIX PERMISSIONS
#=================================================
ynh_script_progression --message="Fix permissions..." --weight=2
# Permissions on files and directories
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -108,10 +118,11 @@ sleep 5
ynh_local_curl "/index.php"
sleep 5
#=================================================
# END OF SCRIPT
#=================================================
# remove directory duplicated
ynh_secure_remove --file="/tmp/data"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last