1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00
bozon_ynh/scripts/upgrade
Éric Gaspar 8260dded0b v2
2023-07-09 21:03:13 +02:00

53 lines
1.5 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
# download & unpack bozon
ynh_script_progression --message="Setting up source files..." --weight=2
## download source
tmpdir=$(mktemp -d)
ynh_setup_source --dest_dir="$tmpdir"
## clean & copy files needed to final folder
myynh_clean_source
[ -e "$tmpdir/config.php" ] && ynh_secure_remove "$tmpdir/config.php"
cp -a "$tmpdir/." "$install_dir"
ynh_secure_remove "$tmpdir"
fi
## set permissions
myynh_set_permissions
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low
ynh_add_nginx_config
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last