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

65 lines
2 KiB
Text
Raw Normal View History

2013-12-06 17:19:45 +01:00
#!/bin/bash
source _common.sh
2017-08-27 14:42:28 +02:00
source /usr/share/yunohost/helpers
ynh_app_setting_set_default --key=php_upload_max_filesize --value=10M
2021-05-18 09:26:51 +02:00
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
2021-05-18 09:26:51 +02:00
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
2021-05-18 09:26:51 +02:00
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
2017-12-18 12:14:16 +01:00
#=================================================
ynh_script_progression "Ensuring downward compatibility..."
2021-05-18 09:26:51 +02:00
ynh_safe_rm "/etc/cron.d/$app"
2017-12-18 12:14:16 +01:00
2017-08-27 14:42:28 +02:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
2017-08-27 14:42:28 +02:00
ynh_setup_source --dest_dir="$install_dir"
2017-08-27 14:42:28 +02:00
echo "$(ynh_app_upstream_version)" > "$install_dir/version_static.txt"
2021-05-18 09:26:51 +02:00
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Upgrading system configurations related to $app..."
2017-08-27 14:42:28 +02:00
ynh_config_add_phpfpm
ynh_config_add_nginx
2017-08-27 14:42:28 +02:00
ynh_config_add_systemd
yunohost service add $app --description="News feed reader and aggregator" --log="/var/log/$app/$app.log"
2017-08-27 14:42:28 +02:00
#=================================================
2021-05-18 09:26:51 +02:00
# UPDATE A CONFIG FILE
2017-08-27 14:42:28 +02:00
#=================================================
ynh_script_progression "Updating configuration..."
2017-08-27 14:42:28 +02:00
ynh_config_add --template="config.php" --destination="$install_dir/config.php"
2013-12-06 17:19:45 +01:00
ynh_exec_as_app php$php_version $install_dir/update.php --update-schema=force-yes
#=================================================
2021-05-18 09:26:51 +02:00
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
ynh_systemctl --service=$app --action="start" --log_path="systemd"
2019-05-01 20:35:48 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2014-12-17 10:44:31 +01:00
ynh_script_progression "Upgrade of $app completed"