get rid of some strange lines in the mastercontainer logs

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-08-31 15:28:43 +02:00
parent ed82a41bc1
commit 999c74a731

View file

@ -2,15 +2,18 @@
while true; do
while [ "$(find "/mnt/docker-aio-config/session/" -mindepth 1 -exec grep "aio_authenticated|[a-z]:1" {} \; | wc -l)" -gt 1 ]; do
# First delete all session files that are not authenticated
unset SESSION_FILES
SESSION_FILES="$(find "/mnt/docker-aio-config/session/" -mindepth 1)"
unset SESSION_FILES_ARRAY
mapfile -t SESSION_FILES_ARRAY <<< "$SESSION_FILES"
for SESSION_FILE in "${SESSION_FILES_ARRAY[@]}"; do
if ! grep -q "aio_authenticated|[a-z]:1" "$SESSION_FILE"; then
if [ -f "$SESSION_FILE" ] && ! grep -q "aio_authenticated|[a-z]:1" "$SESSION_FILE"; then
rm "$SESSION_FILE"
fi
done
# Second clean up all sessions that are authenticated
echo "Deleting duplicate sessions"
unset OLDEST_FILE
set -x