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:
parent
bb025b1255
commit
4a5717daa3
1 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue