2021-05-21 01:10:01 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-12-18 13:50:27 +01:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2021-05-21 01:10:01 +02:00
|
|
|
|
2023-09-05 14:01:32 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop"
|
2021-05-21 01:10:01 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2021-12-18 13:50:27 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2021-05-21 01:10:01 +02:00
|
|
|
|
2023-06-10 22:38:45 +02:00
|
|
|
python_venv_site_packages=$(__ynh_python_venv_get_site_packages_dir -d "$install_dir/venv")
|
2021-05-21 01:10:01 +02:00
|
|
|
|
2023-06-10 22:38:45 +02:00
|
|
|
ynh_change_url_nginx_config
|
2021-05-21 01:10:01 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# Setup ihatemoney.cfg
|
|
|
|
#=================================================
|
2023-06-10 22:38:45 +02:00
|
|
|
#REMOVEME?
|
2023-06-10 21:45:19 +02:00
|
|
|
path="$new_path"
|
2021-05-21 01:10:01 +02:00
|
|
|
domain="$new_domain"
|
|
|
|
|
|
|
|
# Allows to comment some config lines if not using sub path
|
2023-06-10 21:45:19 +02:00
|
|
|
sub_path_only="$(if [[ "$path" == "/" ]]; then echo '# ' ; else echo ''; fi)"
|
2021-05-21 01:10:01 +02:00
|
|
|
|
2023-06-10 21:45:19 +02:00
|
|
|
ynh_add_config --template="../conf/ihatemoney.cfg" --destination="$install_dir/ihatemoney.cfg"
|
|
|
|
chmod 640 "$install_dir/ihatemoney.cfg"
|
|
|
|
chown $app:$app "$install_dir/ihatemoney.cfg"
|
2021-05-21 01:10:01 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-12-18 13:50:27 +01:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=5
|
2021-05-21 01:10:01 +02:00
|
|
|
|
2022-03-13 16:02:11 +01:00
|
|
|
# Start a systemd service
|
2023-09-05 14:01:32 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start"
|
2021-05-21 01:10:01 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-12-18 13:50:27 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|