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:
parent
218805413f
commit
c8d6fbdbe8
1 changed files with 16 additions and 5 deletions
|
@ -30,11 +30,11 @@ if [[ -z "${secret_key:-}" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP SQLITE DATABASE
|
# BACKUP SQLITE DATABASE AND DATAS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5
|
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
|
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.php" --destination="$install_dir/config.local.php"
|
||||||
ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.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
|
# Sync data directory backup
|
||||||
rsync -R /tmp/data/ $install_dir/data/
|
rsync -R /tmp/data/ $install_dir/data/
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# FIX PERMISSIONS
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Fix permissions..." --weight=2
|
||||||
|
|
||||||
# Permissions on files and directories
|
# Permissions on files and directories
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
@ -108,10 +118,11 @@ sleep 5
|
||||||
ynh_local_curl "/index.php"
|
ynh_local_curl "/index.php"
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# END OF SCRIPT
|
|
||||||
#=================================================
|
|
||||||
# remove directory duplicated
|
# remove directory duplicated
|
||||||
ynh_secure_remove --file="/tmp/data"
|
ynh_secure_remove --file="/tmp/data"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||||
|
|
Loading…
Add table
Reference in a new issue