2022-03-26 13:21:17 -07:00
|
|
|
#!/usr/bin/env bash
|
2021-02-12 16:53:51 +01:00
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
cd /usr/src/paperless/src/
|
2022-12-25 15:25:27 -08:00
|
|
|
# This ensures environment is setup
|
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
|
source /sbin/env-from-file.sh
|
2021-02-12 16:53:51 +01:00
|
|
|
|
|
|
|
|
if [[ $(id -u) == 0 ]] ;
|
|
|
|
|
then
|
2022-03-20 15:58:37 +01:00
|
|
|
gosu paperless python3 manage.py management_command "$@"
|
2021-02-12 16:53:51 +01:00
|
|
|
elif [[ $(id -un) == "paperless" ]] ;
|
|
|
|
|
then
|
2022-03-20 15:58:37 +01:00
|
|
|
python3 manage.py management_command "$@"
|
2021-02-12 16:53:51 +01:00
|
|
|
else
|
2022-03-20 15:58:37 +01:00
|
|
|
echo "Unknown user."
|
2021-02-12 16:53:51 +01:00
|
|
|
fi
|