1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/teampass_ynh.git synced 2024-09-03 20:26:37 +02:00
teampass_ynh/scripts/change_url
Éric Gaspar 43b9d20a93 v2
2024-01-29 23:01:15 +01:00

43 lines
1.8 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..."
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# UPDATE THE DATABASE
#=================================================
ynh_mysql_execute_as_root "UPDATE ${app}_misc SET valeur='https://$new_domain$new_path' WHERE intitule='cpassman_url'" $app
ynh_mysql_execute_as_root "UPDATE ${app}_misc SET valeur='https://$new_domain$new_path/favico.ico' WHERE intitule='favicon'" $app
ynh_mysql_execute_as_root "UPDATE ${app}_misc SET valeur='https://$new_domain$new_path/upload' WHERE intitule='url_to_upload_folder'" $app
ynh_mysql_execute_as_root "UPDATE ${app}_misc SET valeur='https://$new_domain$new_path/files' WHERE intitule='url_to_files_folder'" $app
ynh_mysql_execute_as_root "UPDATE ${app}_misc SET valeur='https://$new_domain$new_path' WHERE intitule='email_server_url'" $app
#=================================================
# UPDATE TP.CONFIG.PHP FILE
#=================================================
ynh_replace_string "https://$old_domain$old_path" "https://$new_domain$new_path" "$install_dir/includes/config/tp.config.php"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last