From a64c0f6d417361320d8f9d535808f324b465028c Mon Sep 17 00:00:00 2001 From: thespad Date: Sun, 9 Jun 2024 10:24:51 +0100 Subject: [PATCH] Symlink laravel log to /config --- .../s6-rc.d/init-speedtest-tracker-config/run | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-speedtest-tracker-config/run b/root/etc/s6-overlay/s6-rc.d/init-speedtest-tracker-config/run index cccf9ea..aa4d3f5 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-speedtest-tracker-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-speedtest-tracker-config/run @@ -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