1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/webtrees_ynh.git synced 2024-09-03 18:26:37 +02:00
webtrees_ynh/scripts/upgrade
2024-08-01 21:10:42 +02:00

55 lines
1.7 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression "Ensuring downward compatibility..."
# Migrate manifest questions
ynh_app_setting_set_default --key=admin_username --value=$username
ynh_app_setting_set_default --key=admin_name --value=$name
ynh_app_setting_set_default --key=admin_email --value=$email
if [ -n "${username:-}" ]; then
ynh_app_setting_delete --app="$app" --key="admin_username"
fi
if [ -n "${name:-}" ]; then
ynh_app_setting_delete --app="$app" --key="admin_name"
fi
if [ -n "${email:-}" ]; then
ynh_app_setting_delete --app="$app" --key="admin_email"
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="data modules_v4"
chmod -R 700 "$install_dir/data"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Upgrading system configurations related to $app..."
# Create a dedicated NGINX config
ynh_config_add_nginx
# Create a dedicated PHP-FPM config
ynh_config_add_phpfpm
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Upgrade of $app completed"