mirror of
https://github.com/YunoHost-Apps/ttrss_ynh.git
synced 2024-10-01 13:34:46 +02:00
Fix upgrade
Reconfigure ttrss only if there's an upgrade of the upstream app.
This commit is contained in:
parent
a443cd05cd
commit
f478fd0f3a
1 changed files with 27 additions and 23 deletions
|
@ -125,37 +125,41 @@ ynh_add_fpm_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE TTRSS
|
# CONFIGURE TTRSS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reconfiguring ttrss..." --weight=2
|
|
||||||
|
|
||||||
# Backup the config file in the temp dir
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
cp -a "$final_path/config.php" "$tmpdir/config.php"
|
then
|
||||||
|
ynh_script_progression --message="Reconfiguring ttrss..." --weight=2
|
||||||
|
|
||||||
# Replace the old ttrss by the new one
|
# Backup the config file in the temp dir
|
||||||
ynh_secure_remove --file="$final_path"
|
cp -a "$final_path/config.php" "$tmpdir/config.php"
|
||||||
mv "$tmpdir" "$final_path"
|
|
||||||
ynh_secure_remove --file="$tmpdir"
|
|
||||||
|
|
||||||
# Verify the checksum and backup the file if it's different
|
# Replace the old ttrss by the new one
|
||||||
ynh_backup_if_checksum_is_different --file="$final_path/config.php"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
mv "$tmpdir" "$final_path"
|
||||||
|
ynh_secure_remove --file="$tmpdir"
|
||||||
|
|
||||||
cp ../conf/config.php "$final_path/config.php"
|
# Verify the checksum and backup the file if it's different
|
||||||
|
ynh_backup_if_checksum_is_different --file="$final_path/config.php"
|
||||||
|
|
||||||
# Change variables in ttrss configuration
|
cp ../conf/config.php "$final_path/config.php"
|
||||||
ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config.php"
|
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
|
||||||
ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php"
|
|
||||||
ynh_replace_string --match_string="__DOMAINPATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php"
|
|
||||||
|
|
||||||
# Recalculate and store the config file checksum into the app settings
|
# Change variables in ttrss configuration
|
||||||
ynh_store_file_checksum --file="$final_path/config.php"
|
ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config.php"
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
|
ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php"
|
||||||
|
ynh_replace_string --match_string="__DOMAINPATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php"
|
||||||
|
|
||||||
#=================================================
|
# Recalculate and store the config file checksum into the app settings
|
||||||
# UPGRADE DATABASE
|
ynh_store_file_checksum --file="$final_path/config.php"
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading ttrss database..." --weight=2
|
|
||||||
|
|
||||||
chown -R $app: $final_path
|
#=================================================
|
||||||
ynh_exec_as $app php ${final_path}/update.php --update-schema
|
# UPGRADE DATABASE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading ttrss database..." --weight=2
|
||||||
|
|
||||||
|
chown -R $app: $final_path
|
||||||
|
ynh_exec_as $app php ${final_path}/update.php --update-schema
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
|
Loading…
Add table
Reference in a new issue