diff --git a/scripts/install b/scripts/install index b4a4ad03..2b583984 100644 --- a/scripts/install +++ b/scripts/install @@ -143,24 +143,7 @@ ynh_add_supervisor_config --service="${app}-horizon" --template=horizon.conf --o #================================================= ynh_script_progression --message="Modifying a config file..." -config="$final_path/.env" -cp ../conf/.env "$config" - -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config" -ynh_replace_string --match_string="__APP_KEY__" --replace_string="$app_key" --target_file="$config" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$config" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$config" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_script_progression --message="Storing the config file checksum..." - -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$config" +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" #================================================= # DEPLOY @@ -186,9 +169,7 @@ popd #================================================= ynh_script_progression --message="Installing the cron file..." -cp ../conf/cron "/etc/cron.d/$app" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 15f13bb7..59e6f8aa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -186,20 +186,7 @@ ynh_exec_warn_less ynh_composer_exec --phpversion="$phpversion" --workdir="$fina #================================================= ynh_script_progression --message="Modifying a config file..." -config="$final_path/.env" -ynh_backup_if_checksum_is_different --file="$config" -cp ../conf/.env "$config" - -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config" -ynh_replace_string --match_string="__APP_KEY__" --replace_string="$app_key" --target_file="$config" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$config" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$config" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" - -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$config" +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" #================================================= # DEPLOYMENT @@ -235,9 +222,7 @@ chown -R root: "/var/log/$app/" #================================================= ynh_script_progression --message="Upgrading cron file..." -cp ../conf/cron "/etc/cron.d/$app" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # SETUP SUPERVISOR