2018-05-27 21:20:39 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2020-08-14 23:03:14 +02:00
|
|
|
source _common.sh
|
2018-05-27 21:20:39 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
2022-07-06 06:41:20 +02:00
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop"
|
|
|
|
|
2018-05-27 21:20:39 +02:00
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2020-08-14 12:29:45 +02:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
2018-05-27 21:20:39 +02:00
|
|
|
|
2023-03-11 12:41:37 +01:00
|
|
|
ynh_change_url_nginx_config
|
2018-05-27 21:20:39 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2022-07-06 06:41:20 +02:00
|
|
|
# UPDATE A CONFIG FILE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
2020-08-14 23:08:47 +02:00
|
|
|
|
2022-02-11 09:00:27 +01:00
|
|
|
domain_path="https://${new_domain}${new_path}"
|
2022-02-11 09:01:40 +01:00
|
|
|
domain="$new_domain"
|
2023-03-11 12:41:37 +01:00
|
|
|
ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php"
|
2020-08-15 09:12:59 +02:00
|
|
|
|
2023-03-11 12:41:37 +01:00
|
|
|
chmod 400 "$install_dir/config.php"
|
|
|
|
chown $app "$install_dir/config.php"
|
2020-08-14 23:08:47 +02:00
|
|
|
|
2018-05-27 21:20:39 +02:00
|
|
|
#=================================================
|
2022-07-06 06:41:20 +02:00
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
|
|
|
|
|
|
|
# Start a systemd service
|
|
|
|
ynh_systemd_action --service_name=$app --action="start"
|
|
|
|
|
2019-05-01 20:35:48 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2018-05-27 21:20:39 +02:00
|
|
|
|
2019-05-01 20:35:48 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|