2021-08-25 17:42:59 +02: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
|
|
|
|
|
2022-07-01 01:13:09 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop"
|
2021-08-25 17:42:59 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
2023-03-25 21:16:15 +01:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2022-06-29 02:17:46 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
2021-08-25 17:42:59 +02:00
|
|
|
#=================================================
|
|
|
|
# ADD A CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=2
|
2023-03-25 21:22:04 +01:00
|
|
|
|
2021-08-26 10:19:01 +02:00
|
|
|
domain=$new_domain
|
2023-03-25 21:16:15 +01:00
|
|
|
ynh_add_config --template="../conf/config.js" --destination="$install_dir/server/config.js"
|
2021-08-25 17:42:59 +02:00
|
|
|
|
2023-03-25 21:16:15 +01:00
|
|
|
chmod 400 "$install_dir/server/config.js"
|
|
|
|
chown $app:$app "$install_dir/server/config.js"
|
2021-08-25 17:42:59 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
|
|
|
# Start a systemd service
|
2022-07-01 01:13:52 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
2021-08-25 17:42:59 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|