mirror of
https://github.com/YunoHost-Apps/ttrss_ynh.git
synced 2024-10-01 13:34:46 +02:00
64 lines
2 KiB
Bash
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"
|