1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00

Add ynh_add_config

This commit is contained in:
ericgaspar 2021-04-03 18:40:21 +02:00
parent ce33f37c6a
commit 9f7880e017
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 4 additions and 21 deletions

View file

@ -97,15 +97,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
ynh_script_progression --message="Configuring ttrss..." --weight=1 ynh_script_progression --message="Configuring ttrss..." --weight=1
cp ../conf/config.php "$final_path/config.php" domain_path=$(https://$domain$path_url)
ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php"
# Change variables in ttrss configuration
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.php"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php"
ynh_replace_string --match_string="__DOMAIN_PATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php"
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/config.php"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD

View file

@ -127,18 +127,8 @@ then
mv "$tmpdir" "$final_path" mv "$tmpdir" "$final_path"
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
# Verify the checksum and backup the file if it's different domain_path=$(https://$domain$path_url)
ynh_backup_if_checksum_is_different --file="$final_path/config.php" ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php"
cp ../conf/config.php "$final_path/config.php"
# Change variables in ttrss configuration
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.php"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php"
ynh_replace_string --match_string="__DOMAIN_PATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php"
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/config.php"
#================================================= #=================================================
# UPGRADE DATABASE # UPGRADE DATABASE