Merge pull request #119 from DyonR/dev
Clearer error message about PGID/PUID existence
This commit is contained in:
commit
628dfe3d13
@ -72,18 +72,18 @@ fi
|
||||
# Check if the PGID exists, if not create the group with the name 'qbittorrent'
|
||||
grep $"${PGID}:" /etc/group > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[INFO] A group with PGID $PGID already exists in /etc/group, nothing to do." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
echo "[INFO] A group with PGID $PGID already exists in /etc/group within this container, nothing to do." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
else
|
||||
echo "[INFO] A group with PGID $PGID does not exist, adding a group called 'qbittorrent' with PGID $PGID" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
echo "[INFO] A group with PGID $PGID does not exist within this container, adding a group called 'qbittorrent' with PGID $PGID" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
groupadd -g $PGID qbittorrent
|
||||
fi
|
||||
|
||||
# Check if the PUID exists, if not create the user with the name 'qbittorrent', with the correct group
|
||||
id ${PUID} > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[INFO] An user with PUID $PUID already exists in /etc/passwd, nothing to do." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
echo "[INFO] An user with PUID $PUID already exists within this container, nothing to do." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
else
|
||||
echo "[INFO] An user with PUID $PUID does not exist, adding an user called 'qbittorrent user' with PUID $PUID" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
echo "[INFO] An user with PUID $PUID does not exist within this container, adding an user called 'qbittorrent user' with PUID $PUID" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
useradd -c "qbittorrent user" -g $PGID -u $PUID qbittorrent
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user