mirror of
https://github.com/YunoHost-Apps/redirect_ynh.git
synced 2024-09-03 20:16:10 +02:00
31 lines
847 B
Bash
31 lines
847 B
Bash
#!/bin/bash
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# ENSURE DOWNWARD COMPATIBILITY
|
|
#=================================================
|
|
|
|
if [[ "${redirect_type:-}" == *"proxy"* ]]
|
|
then
|
|
redirect_type="reverseproxy"
|
|
else
|
|
redirect_type="redirect"
|
|
fi
|
|
ynh_app_setting_set $app 'redirect_type' $redirect_type
|
|
|
|
if [[ -z "${target:-}" ]] && [[ -n "${redirect_path:-}" ]]
|
|
then
|
|
target="$redirect_path"
|
|
ynh_app_setting_set $app target "$redirect_path"
|
|
fi
|
|
|
|
#=================================================
|
|
# CONFIGURE NGINX
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
|
|
|
mv ../conf/{nginx-$redirect_type.conf,nginx.conf}
|
|
ynh_add_nginx_config
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|