Symlink .env rather than copy

This commit is contained in:
aptalca
2018-10-07 12:07:45 -04:00
parent 7c3bb91996
commit 80d7e5e8c7
3 changed files with 8 additions and 6 deletions

View File

@@ -4,12 +4,17 @@
mkdir -p \
/config/www/{backgrounds,icons}
# copy .env if not exists
[[ ! -f /config/www/.env ]] && \
cp /var/www/localhost/heimdall/.env /config/www/.env
# create symlinks
symlinks=( \
/var/www/localhost/heimdall/storage/app/public/backgrounds \
/var/www/localhost/heimdall/storage/app/public/icons \
/var/www/localhost/heimdall/database/app.sqlite )
/var/www/localhost/heimdall/database/app.sqlite \
/var/www/localhost/heimdall/.env )
for i in "${symlinks[@]}"
do
@@ -17,11 +22,6 @@ do
[[ ! -L "$i" ]] && ln -s /config/www/"$(basename "$i")" "$i"
done
# sync .env
[[ ! -f /config/.env ]] && \
cp /var/www/localhost/heimdall/.env /config/.env
cp /config/.env /var/www/localhost/heimdall/.env
# permissions
chown -R abc:abc \
/config \