funkwhale_beets_plugin/auto_import.sh

14 lines
332 B
Bash
Executable File

#!/bin/bash
USER=$(id -un)
if [ "$USER" != "funkwhale" ]; then
exec sudo -u funkwhale $0 "$@"
elif [ "$USER" == "funkwhale" ]; then
echo "activating venv"
cd /opt/funkwhale
source virtualenv/bin/activate
export $(cat prod.env)
echo "venv activated. Importing now"
echo "$@"
exec /opt/funkwhale/api/manage.py "$@"
fi