1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wikijs_ynh.git synced 2024-09-03 20:36:09 +02:00

ynh_add_config

This commit is contained in:
yalh76 2021-02-26 01:34:32 +01:00
parent 858d60e7bb
commit 502bb5e568
2 changed files with 5 additions and 35 deletions

View file

@ -135,20 +135,7 @@ ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH"
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Modifying a config file..."
config_file="$final_path/config.yml" ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml"
cp -f ../conf/config.sample.yml $config_file
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
#=================================================
# 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_file"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -200,12 +187,8 @@ ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
ynh_script_progression --message="Sending ReadMe to admin..." ynh_script_progression --message="Sending ReadMe to admin..."
ynh_replace_string --match_string="__LDAP_USER__" --replace_string="$ldap_user" --target_file="../conf/ldap_message" ynh_add_config --template="../conf/ldap_message" --destination="../conf/install"
ynh_replace_string --match_string="__LDAP_PASSWORD__" --replace_string="$ldap_password" --target_file="../conf/ldap_message" ynh_send_readme_to_admin --app_message="../conf/install" --recipients="root" --type='install'
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/ldap_message"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/ldap_message"
ynh_send_readme_to_admin --app_message="../conf/ldap_message" --recipients="root" --type='install'
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -154,16 +154,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Modifying a config file..."
config_file="$final_path/config.yml" ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml"
ynh_backup_if_checksum_is_different --file=$config_file
cp -f ../conf/config.sample.yml $config_file
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config_file"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -209,11 +200,7 @@ ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
ynh_script_progression --message="Sending ReadMe to admin..." ynh_script_progression --message="Sending ReadMe to admin..."
ynh_replace_string --match_string="__LDAP_USER__" --replace_string="$ldap_user" --target_file="../conf/ldap_message" ynh_add_config --template="../conf/ldap_message" --destination="../conf/upgrade"
ynh_replace_string --match_string="__LDAP_PASSWORD__" --replace_string="$ldap_password" --target_file="../conf/ldap_message"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/ldap_message"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="../conf/ldap_message"
ynh_send_readme_to_admin --app_message="../conf/ldap_message" --recipients="root" --type='upgrade' ynh_send_readme_to_admin --app_message="../conf/ldap_message" --recipients="root" --type='upgrade'
#================================================= #=================================================