summarylogtreecommitdiffstats
path: root/funkwhale_manage
blob: f797d3863c4efc758de461b04a9fdfe1195290fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/bash

if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 
   exit 1
fi

# change user -> funkwhale
#sudo -u funkwhale -H bash
su funkwhale -s /bin/bash << EOF
export $(cat /srv/funkwhale/config/env | grep -v ^# | xargs)
# enter virtualenv
source /usr/share/webapps/funkwhale/virtualenv/bin/activate
python /usr/share/webapps/funkwhale/api/manage.py $@
deactivate
EOF