mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
52 lines
1.6 KiB
Bash
52 lines
1.6 KiB
Bash
#!/bin/bash
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Stopping $app's systemd service..."
|
|
|
|
ynh_systemctl --service=$app --action="stop"
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression "Updating NGINX web server configuration..."
|
|
|
|
python_venv_site_packages=$(__ynh_python_venv_get_site_packages_dir -d "$install_dir/venv")
|
|
|
|
ynh_config_change_url_nginx
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
# Setup ihatemoney.cfg
|
|
#=================================================
|
|
|
|
path="$new_path"
|
|
domain="$new_domain"
|
|
|
|
# Allows to comment some config lines if not using sub path
|
|
sub_path_only="$(if [[ "$path" == "/" ]]; then echo '# ' ; else echo ''; fi)"
|
|
|
|
ynh_config_add --template="ihatemoney.cfg" --destination="$install_dir/ihatemoney.cfg"
|
|
|
|
chmod 640 "$install_dir/ihatemoney.cfg"
|
|
chown "$app:$app" "$install_dir/ihatemoney.cfg"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression "Starting $app's systemd service..."
|
|
|
|
# Start a systemd service
|
|
ynh_systemctl --service="$app" --action="start"
|
|
wait_gunicorn_start
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression "Change of URL completed for $app"
|