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
|
|
|
|
#=================================================
|
2023-12-05 20:36:42 +01:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2022-07-06 06:41:20 +02:00
|
|
|
|
2023-12-05 20:36:42 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
2022-07-06 06:41:20 +02:00
|
|
|
|
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 13:53:38 +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-12-06 11:24:27 +01:00
|
|
|
ynh_add_config --template="config.php" --destination="$install_dir/config.php"
|
2020-08-15 09:12:59 +02:00
|
|
|
|
2023-03-11 13:53:38 +01:00
|
|
|
chmod 400 "$install_dir/config.php"
|
|
|
|
chown $app "$install_dir/config.php"
|
2020-08-14 23:08:47 +02:00
|
|
|
|
2022-07-06 06:41:20 +02:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
|
|
|
|
2023-12-05 20:36:42 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
2022-07-06 06:41:20 +02:00
|
|
|
|
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
|