mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
45 lines
1.6 KiB
Bash
45 lines
1.6 KiB
Bash
#!/bin/bash
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Stopping $app's systemd service..."
|
|
|
|
ynh_systemctl --service=$app --action=stop --log_path="systemd"
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression "Updating NGINX web server configuration..."
|
|
|
|
ynh_config_change_url_nginx
|
|
|
|
#=================================================
|
|
# EDIT MATTERMOST CONFIG
|
|
#=================================================
|
|
# MODIFY A CONFIG FILE
|
|
#=================================================
|
|
ynh_script_progression "Updating configuration..."
|
|
|
|
# Main config File
|
|
ynh_replace --match="\"SiteURL\": \".*\"" --replace="\"SiteURL\": \"https://${new_domain}${new_path}\"" --file="$install_dir/config/config.json"
|
|
ynh_replace --match="\"FeedbackEmail\": \".*\"" --replace="\"FeedbackEmail\": \"no-reply@${new_domain}\"" --file="$install_dir/config/config.json"
|
|
|
|
ynh_store_file_checksum "$install_dir/config/config.json"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Starting $app's systemd service..."
|
|
|
|
# Start a systemd service
|
|
ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="Started Mattermost"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression "Change of URL completed for $app"
|