1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/webtrees_ynh.git synced 2024-09-03 18:26:37 +02:00
This commit is contained in:
yalh76 2019-04-18 04:58:41 +02:00
parent c7e4db187a
commit 3f638e9f75

View file

@ -85,29 +85,6 @@ ynh_print_info "Configuring nginx web server..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# MODIFY A CONFIG FILE
#=================================================
# Adding the details of the database to the config file
ynh_replace_string "__dbuser__" "$db_name" "../conf/config.ini.php"
ynh_replace_string "__dbpass__" "$db_pwd" "../conf/config.ini.php"
ynh_replace_string "__dbname__" "$db_name" "../conf/config.ini.php"
# Copy the config file to the final path
sudo cp ../conf/config.ini.php $final_path/data/.
# Load initial SQL into the new database
ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "../conf/sql/webtrees.sql"
# Replace variables in sql scripts
ynh_replace_string "__USER_NAME__" "$admin_username" "../conf/sql/admin.sql"
ynh_replace_string "__NAME__" "$admin_name" "../conf/sql/admin.sql"
ynh_replace_string "__USER_EMAIL__" "$admin_email" "../conf/sql/admin.sql"
ynh_replace_string "__PASSWORD__" "$admin_password" "../conf/sql/admin.sql"
ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "../conf/sql/admin.sql"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -131,6 +108,29 @@ ynh_add_fpm_config
chown -R $app: $final_path chown -R $app: $final_path
sudo chmod -R 700 $final_path/data sudo chmod -R 700 $final_path/data
#=================================================
# MODIFY A CONFIG FILE
#=================================================
# Adding the details of the database to the config file
ynh_replace_string "__dbuser__" "$db_name" "../conf/config.ini.php"
ynh_replace_string "__dbpass__" "$db_pwd" "../conf/config.ini.php"
ynh_replace_string "__dbname__" "$db_name" "../conf/config.ini.php"
# Copy the config file to the final path
sudo cp ../conf/config.ini.php $final_path/data/.
# Load initial SQL into the new database
ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "../conf/sql/webtrees.sql"
# Replace variables in sql scripts
ynh_replace_string "__USER_NAME__" "$admin_username" "../conf/sql/admin.sql"
ynh_replace_string "__NAME__" "$admin_name" "../conf/sql/admin.sql"
ynh_replace_string "__USER_EMAIL__" "$admin_email" "../conf/sql/admin.sql"
ynh_replace_string "__PASSWORD__" "$admin_password" "../conf/sql/admin.sql"
ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "../conf/sql/admin.sql"
#================================================= #=================================================
# STORE THE CONFIG FILE CHECKSUM # STORE THE CONFIG FILE CHECKSUM
#================================================= #=================================================