#!/bin/bash # This is the tutorial version of the app. # It contains extra commands to explain what should be done in case you want to adjust some part of the script. # Once you are done, you may remove them. #================================================= # GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # STOP SUPERVISOR SERVICE #================================================= ynh_script_progression --message="Stopping a supervisor service..." supervisorctl stop ${app} #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." ynh_change_url_nginx_config #================================================= # SPECIFIC MODIFICATIONS #================================================= pushd $install_dir ynh_add_config --template="../conf/extra_diacamma.json" --destination="/tmp/extra.json" if [ "$path" == "/" ] then sed -i "/USE_X_FORWARDED_HOST/d" /tmp/extra.json sed -i "/FORCE_SCRIPT_NAME/d" /tmp/extra.json sed -i "/USE_X_FORWARDED_HOST/d" $install_dir/inst-${app}/settings.py sed -i "/FORCE_SCRIPT_NAME/d" $install_dir/inst-${app}/settings.py fi extra_json=$(jq -c . /tmp/extra.json) venv/bin/lucterios_admin.py modif -n inst-${app} -e ''$extra_json'' popd #================================================= # START SUPERVISOR SERVICE #================================================= ynh_script_progression --message="Starting a supervisor service..." supervisorctl start ${app} #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Change of URL completed for $app" --last