1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00
ttrss_ynh/scripts/upgrade
eric_G 33505d27a9
[autopatch] Automatic patch attempt for helpers 2.1 (#168) (#169)
* [autopatch] Automatic patch attempt for helpers 2.1 (#168)

* [autopatch] Automatic patch attempt for helpers 2.1

* cleaning

---------

Co-authored-by: Yunohost-Bot <>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Auto-update READMEs

* cleaning

* Auto-update READMEs

---------

Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
2024-09-08 13:32:10 +02:00

64 lines
2 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
ynh_app_setting_set_default --key=php_upload_max_filesize --value=10M
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression "Ensuring downward compatibility..."
ynh_safe_rm "/etc/cron.d/$app"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir"
echo "$(ynh_app_upstream_version)" > "$install_dir/version_static.txt"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Upgrading system configurations related to $app..."
ynh_config_add_phpfpm
ynh_config_add_nginx
ynh_config_add_systemd
yunohost service add $app --description="News feed reader and aggregator" --log="/var/log/$app/$app.log"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression "Updating configuration..."
ynh_config_add --template="config.php" --destination="$install_dir/config.php"
ynh_exec_as_app php$php_version $install_dir/update.php --update-schema=force-yes
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
ynh_systemctl --service=$app --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Upgrade of $app completed"