1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/bozon_ynh.git synced 2024-09-03 18:16:09 +02:00

Fix root install

This commit is contained in:
ewilly 2018-05-01 14:46:22 +02:00
parent 1640590385
commit d483952087

View file

@ -44,9 +44,13 @@ myynh_add_nginx_config () {
cp ../conf/nginx.conf "$nginx_conf" cp ../conf/nginx.conf "$nginx_conf"
# To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable. # To avoid a break by set -u, use a void substitution ${var:-}. If the variable is not set, it's simply set with an empty variable.
# Substitute in a nginx config file only if the variable is not empty # Substitute in a nginx config file only if the variable is not empty
[ -n "${path_url:-}" ] && ynh_replace_string "__PATH__" "$path_url" "$nginx_conf" if test -n "${path_url:-}"; then
if [ "${path_url:-}" != "/" ]; then if [ "${path_url:-}" != "/" ]; then
ynh_replace_string "^#sub_path_only" "" "$nginx_conf" ynh_replace_string "^#sub_path_only" "" "$nginx_conf"
ynh_replace_string "__PATH__" "$path_url" "$nginx_conf"
else
ynh_replace_string "__PATH__/" "$path_url" "$nginx_conf"
fi
fi fi
[ -n "${final_path:-}" ] && ynh_replace_string "__FINALPATH__" "$final_path" "$nginx_conf" [ -n "${final_path:-}" ] && ynh_replace_string "__FINALPATH__" "$final_path" "$nginx_conf"
[ -n "${app:-}" ] && ynh_replace_string "__NAME__" "$app" "$nginx_conf" [ -n "${app:-}" ] && ynh_replace_string "__NAME__" "$app" "$nginx_conf"