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

Adjust upgrade to path variable

This commit is contained in:
polytan02 2017-02-22 15:51:47 +00:00 committed by GitHub
parent bb025b1255
commit 4a5717daa3

View file

@ -3,6 +3,8 @@
# Exit on command errors and treat unset variables as an error
set -eu
source .functions
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
@ -16,8 +18,8 @@ admin=$(ynh_app_setting_get "$app" admin)
is_public=$(ynh_app_setting_get "$app" is_public)
language=$(ynh_app_setting_get "$app" language)
# Remove trailing "/" for next commands
path=${path%/}
# Check path and correct if required
CHECK_PATH
# Copy source files
src_path=/var/www/$app
@ -29,9 +31,17 @@ sudo cp -a ../sources/. $src_path
sudo chown -R root: $src_path
# Modify Nginx configuration file and copy it to Nginx conf directory
### Nginx ###
if [ $path = "/" ]; then
nginx_conf=../conf/nginx_root.conf
else
nginx_conf=../conf/nginx.conf
fi
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
sed -i "s@YNH_WWW_ALIAS@$app/@g" $nginx_conf
sed -i "s@YNH_WWW_APP@$app@g" $nginx_conf
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
# If a dedicated php-fpm process is used:
#
sed -i "s@YNH_WWW_APP@$app@g" $nginx_conf