2022-07-16 22:20:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-09-10 17:15:08 +00:00
|
|
|
if [ "$CLEAN_DOWNLOADS" != "true" ]; then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-07-16 22:20:38 +00:00
|
|
|
echo "Info|Lidarr event: $lidarr_eventtype" >&2
|
|
|
|
|
|
|
|
# Handle Lidarr Test event
|
|
|
|
if [[ "$lidarr_eventtype" = "Test" ]]; then
|
|
|
|
echo "Info|Script was test executed successfully." >&2
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Info|Cleaning empty folders" >&2
|
|
|
|
find /downloads -type d -empty -print -delete >&2
|