2019-03-03 18:04:55 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
2020-04-20 04:16:40 +02:00
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2020-05-30 16:34:01 +02:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
2020-04-20 04:16:40 +02:00
|
|
|
|
2023-04-18 17:06:24 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="$install_dir/log/production.log"
|
2020-04-20 04:16:40 +02:00
|
|
|
|
2019-03-03 18:04:55 +01:00
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2020-11-01 18:24:02 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
2019-03-03 18:04:55 +01:00
|
|
|
|
2023-04-18 17:06:24 +02:00
|
|
|
ynh_change_url_nginx_config
|
2019-03-03 18:04:55 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2020-05-30 16:34:01 +02:00
|
|
|
# CONFIGURE LUFI
|
2019-03-03 18:04:55 +01:00
|
|
|
#=================================================
|
2020-05-30 16:34:01 +02:00
|
|
|
ynh_script_progression --message="Configuring lufi..."
|
2019-03-03 18:04:55 +01:00
|
|
|
|
|
|
|
domain="$new_domain"
|
2023-04-18 17:06:24 +02:00
|
|
|
path="$new_path"
|
2019-03-03 18:04:55 +01:00
|
|
|
|
2022-01-19 21:01:53 +01:00
|
|
|
ldap="#"
|
2022-01-19 20:47:13 +01:00
|
|
|
if [ $use_ldap -eq 1 ];
|
2019-03-03 18:04:55 +01:00
|
|
|
then
|
2022-01-19 21:01:53 +01:00
|
|
|
ldap=""
|
|
|
|
fi
|
|
|
|
|
2023-04-18 17:06:24 +02:00
|
|
|
ynh_add_config --template="../conf/lufi.conf" --destination="$install_dir/lufi.conf"
|
2019-03-03 18:04:55 +01:00
|
|
|
|
2023-04-18 17:06:24 +02:00
|
|
|
chmod 600 $install_dir/lufi.conf
|
|
|
|
chown $app:$app $install_dir/lufi.conf
|
2021-05-08 23:38:59 +02:00
|
|
|
|
2019-03-03 18:04:55 +01:00
|
|
|
#=================================================
|
2020-04-20 04:16:40 +02:00
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
2019-03-03 18:04:55 +01:00
|
|
|
#=================================================
|
2020-05-30 16:34:01 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
2019-03-03 18:04:55 +01:00
|
|
|
|
2022-06-16 19:19:38 +02:00
|
|
|
# Start a systemd service
|
2023-04-18 17:06:24 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="$install_dir/log/production.log" --line_match="Creating process id file"
|
2019-03-03 18:04:55 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-05-30 16:34:01 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app"
|