mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-11-15 03:24:48 +08:00
3118ecf385
Signed-off-by: szaimen <szaimen@e.mail.de>
22 lines
656 B
Bash
22 lines
656 B
Bash
#!/bin/bash
|
|
|
|
deduplicate_sessions() {
|
|
echo "Deleting duplicate sessions"
|
|
find "/mnt/docker-aio-config/session/" -mindepth 1 -exec grep -qv "$NEW_SESSION_TIME" {} \; -delete
|
|
}
|
|
|
|
compare_times() {
|
|
if [ -f "/mnt/docker-aio-config/data/session_date_file" ]; then
|
|
unset NEW_SESSION_TIME
|
|
NEW_SESSION_TIME="$(cat "/mnt/docker-aio-config/data/session_date_file")"
|
|
if [ -n "$NEW_SESSION_TIME" ] && [ -n "$OLD_SESSION_TIME" ] && [ "$NEW_SESSION_TIME" != "$OLD_SESSION_TIME" ]; then
|
|
deduplicate_sessions
|
|
fi
|
|
OLD_SESSION_TIME="$NEW_SESSION_TIME"
|
|
fi
|
|
}
|
|
|
|
while true; do
|
|
compare_times
|
|
sleep 2
|
|
done
|