mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 18:31:02 +01:00
Update and rename 00-refresh_files.sh to 02-refresh_files.sh
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Clean nginx files at each reboot
|
||||
if [ -d /data/config/nginx ]; then
|
||||
rm -r /data/config/nginx
|
||||
fi
|
||||
|
||||
# rm /data/config/crontabs
|
||||
if [ -d /data/config/crontabs ]; then
|
||||
rm -r /data/config/crontabs
|
||||
fi
|
||||
17
nextcloud/rootfs/etc/cont-init.d/02-refresh_files.sh
Executable file
17
nextcloud/rootfs/etc/cont-init.d/02-refresh_files.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Clean nginx files at each reboot
|
||||
for folders in /data/config/nginx /data/config/crontabs /data/config/logs; do
|
||||
if [ -d "$folders" ]; then rm -r "$folders"; fi
|
||||
done
|
||||
|
||||
# Make links between logs and docker
|
||||
for logfile in /data/config/log/nginx/error.log /data/config/log/nginx/access.log /data/config/log/php/error.log /data/config/log/nextcloud.log; do
|
||||
# Make sure directory exists
|
||||
mkdir -p "$(dirname "$logfile")"
|
||||
# Clean files
|
||||
if [ -f "$logfile" ]; then rm -r "$logfile"; fi
|
||||
# Create symlink
|
||||
ln -sf /proc/1/fd/1 "$logfile"
|
||||
done
|
||||
Reference in New Issue
Block a user