Files
sonobarr/init.sh
2025-10-06 18:22:09 +00:00

32 lines
1.3 KiB
Bash

#!/bin/sh
echo -e "\033[1;34mSonobarr\033[0m"
echo "Initializing app..."
cat << 'EOF'
██ _______. ______ .__ __. ______ .______ ___ .______ .______
██ / | / __ \ | \ | | / __ \ | _ \ / \ | _ \ | _ \
██ ██ ▄▄ | (----`| | | | | \| | | | | | | |_) | / ^ \ | |_) | | |_) |
██ ██ ██ ██ \ \ | | | | | . ` | | | | | | _ < / /_\ \ | / | /
██ ██ ██ ██ ██ .----) | | `--' | | |\ | | `--' | | |_) | / _____ \ | |\ \----. | |\ \----.
██ ██ ██ ██ ██ |_______/ \______/ |__| \__| \______/ |______/ /__/ \__\ | _| `._____| | _| `._____|
EOF
PUID=${PUID:-1000}
PGID=${PGID:-1000}
echo "-----------------"
echo -e "\033[1mRunning with:\033[0m"
echo "PUID=${PUID}"
echo "PGID=${PGID}"
echo "-----------------"
# Create the required directories with the correct permissions
echo "Setting up directories.."
mkdir -p /sonobarr/config
chown -R ${PUID}:${PGID} /sonobarr
# Start the application with the specified user permissions
echo "Running Sonobarr..."
exec su-exec ${PUID}:${PGID} gunicorn src.Sonobarr:app -c gunicorn_config.py