2021-01-12 18:39:03 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-01-16 21:51:49 +01:00
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
2021-01-12 18:39:03 +01:00
|
|
|
|
2024-01-16 21:51:49 +01:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
|
|
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config.php"
|
2021-01-12 18:39:03 +01:00
|
|
|
|
2024-01-16 22:09:17 +01:00
|
|
|
chmod 750 "$install_dir"
|
2024-01-16 21:51:49 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2021-11-14 15:42:49 +01:00
|
|
|
|
2021-01-12 18:39:03 +01:00
|
|
|
#=================================================
|
2024-01-16 21:51:49 +01:00
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
2021-01-12 18:39:03 +01:00
|
|
|
#=================================================
|
2024-01-16 21:51:49 +01:00
|
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
2021-01-12 18:39:03 +01:00
|
|
|
|
2021-11-14 15:42:49 +01:00
|
|
|
ynh_add_fpm_config
|
2021-01-12 18:39:03 +01:00
|
|
|
|
2024-01-16 21:51:49 +01:00
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2021-02-10 18:00:18 +01:00
|
|
|
#=================================================
|
|
|
|
# UPDATE THE CRON JOB
|
|
|
|
#=================================================
|
2024-01-16 21:51:49 +01:00
|
|
|
ynh_script_progression --message="Setting up a cron..." --weight=1
|
2021-02-10 18:00:18 +01:00
|
|
|
|
2021-07-17 12:00:15 +02:00
|
|
|
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
|
|
|
chown root: "/etc/cron.d/$app"
|
|
|
|
chmod 644 "/etc/cron.d/$app"
|
2021-02-10 18:00:18 +01:00
|
|
|
|
2021-01-12 18:39:03 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-17 12:00:15 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|