Merge pull request #1096 from nextcloud/fix/noid/mastercontainer-logs

get rid of some strange lines in the mastercontainer logs
This commit is contained in:
Simon L 2022-09-08 15:44:11 +02:00 committed by GitHub
commit 3bc55fb104
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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