2021-11-25 15:34:19 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
2023-03-02 12:02:35 +01:00
|
|
|
ynh_change_url_nginx_config
|
2021-11-25 15:34:19 +01:00
|
|
|
|
2021-11-25 18:17:54 +01:00
|
|
|
#=================================================
|
|
|
|
# ADD A CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|
|
|
|
|
|
|
domain="$new_domain"
|
2024-06-02 09:53:51 +02:00
|
|
|
ynh_add_config --template=".env" --destination="$install_dir/commento.env"
|
2021-11-25 18:17:54 +01:00
|
|
|
|
2023-03-02 12:06:05 +01:00
|
|
|
chmod 400 "$install_dir/commento.env"
|
|
|
|
chown $app:$app "$install_dir/commento.env"
|
2021-11-25 18:17:54 +01:00
|
|
|
|
2021-11-25 15:34:19 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
2021-11-25 15:42:23 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd
|
2021-11-25 15:34:19 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|