funkwhale_beets_plugin/auto_import.sh

14 lines
332 B
Bash
Raw Permalink Normal View History

2019-06-12 12:22:57 +02:00
#!/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