mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Start Tautulli using different user in Docker container
This commit is contained in:
parent
40fd82febd
commit
fef428202f
1 changed files with 16 additions and 5 deletions
21
start.sh
21
start.sh
|
@ -1,10 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$TAUTULLI_DOCKER" = "True" && -v PUID && -v PGID ]]; then
|
||||
getent group "$PGID" 2>&1 > /dev/null || groupadd -g "$PGID" tautulli
|
||||
getent passwd "$PUID" 2>&1 > /dev/null || useradd -r -u "$PUID" -g "$PGID" tautulli
|
||||
chown -f -R "$PUID":"$PGID" /config
|
||||
python Tautulli.py --datadir /config
|
||||
if [[ "$TAUTULLI_DOCKER" = "True" ]]; then
|
||||
if [[ -v PUID && -v PGID ]]; then
|
||||
getent group "$PGID" 2>&1 > /dev/null || groupadd -g "$PGID" tautulli
|
||||
getent passwd "$PUID" 2>&1 > /dev/null || useradd -r -u "$PUID" -g "$PGID" tautulli
|
||||
|
||||
user=$(getent passwd "$PUID" | cut -d: -f1)
|
||||
group=$(getent group "$PGID" | cut -d: -f1)
|
||||
usermod -a -G root "$user"
|
||||
|
||||
chown -R "$user":"$group" /config
|
||||
|
||||
echo "Running Tautulli using user $user (uid=$PUID) and group $group (gid=$PGID)"
|
||||
su "$user" -g "$group" -c "python /app/Tautulli.py --datadir /config"
|
||||
else
|
||||
python Tautulli.py --datadir /config
|
||||
fi
|
||||
else
|
||||
python Tautulli.py &> /dev/null &
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue