mirror of
https://github.com/YunoHost-Apps/wallabag2_ynh.git
synced 2024-10-01 13:35:06 +02:00
Fix install script by avoiding to enter directory with wrong permissions. Also use absolute path for config files.
This commit is contained in:
parent
e4f63f65b0
commit
e37ad572ee
2 changed files with 11 additions and 11 deletions
|
@ -44,9 +44,7 @@ exec_console() {
|
|||
local AS_USER=$1
|
||||
local WORKDIR=$2
|
||||
shift 2
|
||||
|
||||
(cd "$WORKDIR" && \
|
||||
exec_as "$AS_USER" php "bin/console" --no-interaction --env=prod $@)
|
||||
exec_as "$AS_USER" php "bin/console" --no-interaction --env=prod $@
|
||||
}
|
||||
|
||||
# Download and extract Wallabag sources to the given directory
|
||||
|
|
|
@ -60,6 +60,8 @@ sed -i "s@{DESKEY}@${deskey}@g" "$wb_conf"
|
|||
|
||||
# Install files and set permissions
|
||||
sudo mv "$TMPDIR" "$DESTDIR"
|
||||
|
||||
cd $DESTDIR
|
||||
sudo chown -R www-data: "$DESTDIR"
|
||||
|
||||
# Install dependencies and Wallabag
|
||||
|
@ -79,17 +81,17 @@ exec_console www-data "$DESTDIR" fos:user:promote --super "$admin"
|
|||
|
||||
# Copy and set nginx configuration
|
||||
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||
sed -i "s@{LOCATION}@${path:-/}@g" ../conf/nginx.conf
|
||||
sed -i "s@{PATH}@${path}@g" ../conf/nginx.conf
|
||||
sed -i "s@{DESTDIR}@${DESTDIR}@g" ../conf/nginx.conf
|
||||
sed -i "s@{POOLNAME}@${app}@g" ../conf/nginx.conf
|
||||
sudo cp ../conf/nginx.conf "$nginx_conf"
|
||||
sed -i "s@{LOCATION}@${path:-/}@g" $PKGDIR/conf/nginx.conf
|
||||
sed -i "s@{PATH}@${path}@g" $PKGDIR/conf/nginx.conf
|
||||
sed -i "s@{DESTDIR}@${DESTDIR}@g" $PKGDIR/conf/nginx.conf
|
||||
sed -i "s@{POOLNAME}@${app}@g" $PKGDIR/conf/nginx.conf
|
||||
sudo cp $PKGDIR/conf/nginx.conf "$nginx_conf"
|
||||
|
||||
# Copy and set php-fpm configuration
|
||||
phpfpm_conf="/etc/php5/fpm/pool.d/${app}.conf"
|
||||
sed -i "s@{POOLNAME}@${app}@g" ../conf/php-fpm.conf
|
||||
sed -i "s@{DESTDIR}@${DESTDIR}/@g" ../conf/php-fpm.conf
|
||||
sudo cp ../conf/php-fpm.conf "$phpfpm_conf"
|
||||
sed -i "s@{POOLNAME}@${app}@g" $PKGDIR/conf/php-fpm.conf
|
||||
sed -i "s@{DESTDIR}@${DESTDIR}/@g" $PKGDIR/conf/php-fpm.conf
|
||||
sudo cp $PKGDIR/conf/php-fpm.conf "$phpfpm_conf"
|
||||
|
||||
# Set SSOwat rules
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
|
|
Loading…
Add table
Reference in a new issue