Merge pull request #21 from linuxserver/laravel-log

Symlink laravel log to /config
This commit is contained in:
Adam 2024-06-09 13:55:50 +01:00 committed by GitHub
commit 306aa1e6fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,20 +64,21 @@ lsiown -R abc:abc \
# Check for env file
if [[ -f /config/.env ]]; then
# create symlinks
symlinks=( \
/app/www/.env \
)
if [[ -e "/app/www/.env" && ! -L "/app/www/.env" ]]; then
rm -rf "/app/www/.env"
fi
if [[ ! -L "/app/www/.env" ]]; then
ln -s "/config/.env" "/app/www/.env"
fi
fi
for i in "${symlinks[@]}"
do
if [[ -e "$i" && ! -L "$i" ]]; then
rm -rf "$i"
fi
if [[ ! -L "$i" ]]; then
ln -s /config/"$(basename "$i")" "$i"
fi
done
touch /config/log/laravel.log
if [[ -e "/app/www/storage/logs/laravel.log" && ! -L "/app/www/storage/logs/laravel.log" ]]; then
rm -rf "/app/www/storage/logs/laravel.log"
fi
if [[ ! -L "/app/www/storage/logs/laravel.log" ]]; then
ln -s "/config/log/laravel.log" "/app/www/storage/logs/laravel.log"
fi
# Check for app key