1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/diacamma_ynh.git synced 2024-09-03 18:26:10 +02:00
diacamma_ynh/scripts/change_url

58 lines
1.9 KiB
Text
Raw Normal View History

2023-12-11 17:56:26 +01:00
#!/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
#=================================================
2023-12-17 18:45:44 +01:00
# STOP SUPERVISOR SERVICE
2023-12-11 17:56:26 +01:00
#=================================================
2023-12-17 18:45:44 +01:00
ynh_script_progression --message="Stopping a supervisor service..."
2023-12-11 17:56:26 +01:00
2023-12-17 18:45:44 +01:00
supervisorctl stop ${app}
2023-12-11 17:56:26 +01:00
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..."
ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
2023-12-16 16:45:14 +01:00
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
2023-12-18 10:49:36 +01:00
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
2023-12-16 16:45:14 +01:00
fi
extra_json=$(jq -c . /tmp/extra.json)
venv/bin/lucterios_admin.py modif -n inst-${app} -e ''$extra_json''
popd
2023-12-11 17:56:26 +01:00
#=================================================
2023-12-17 18:45:44 +01:00
# START SUPERVISOR SERVICE
2023-12-11 17:56:26 +01:00
#=================================================
2023-12-17 18:45:44 +01:00
ynh_script_progression --message="Starting a supervisor service..."
2023-12-11 17:56:26 +01:00
2023-12-17 18:45:44 +01:00
supervisorctl start ${app}
2023-12-11 17:56:26 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last