mirror of
https://github.com/MarkusMcNugen/docker-qBittorrentvpn
synced 2024-11-25 20:14:58 +00:00
add PUID/PGID to OS if missing
This commit is contained in:
parent
1f1a7de7c3
commit
c78a32ed22
@ -11,6 +11,25 @@ if [[ ! -e /config/qBittorrent/config/qBittorrent.conf ]]; then
|
|||||||
chmod 755 /config/qBittorrent/config/qBittorrent.conf
|
chmod 755 /config/qBittorrent/config/qBittorrent.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Check for missing group
|
||||||
|
/bin/egrep -i "^${PGID}:" /etc/passwd
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Group $PGID exists"
|
||||||
|
else
|
||||||
|
echo "Adding $PGID group"
|
||||||
|
groupadd -g $PGID qbittorent
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Check for missing userid
|
||||||
|
/bin/egrep -i "^${PUID}:" /etc/passwd
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "User $PUID exists in /etc/passwd"
|
||||||
|
else
|
||||||
|
echo "Adding $PUID user"
|
||||||
|
useradd -c "qbittorent user" -g $PGID -u $PUID qbittorent
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Set qBittorrent WebUI and Incoming ports
|
# Set qBittorrent WebUI and Incoming ports
|
||||||
if [ ! -z "${WEBUI_PORT}" ]; then
|
if [ ! -z "${WEBUI_PORT}" ]; then
|
||||||
webui_port_exist=$(cat /config/qBittorrent/config/qBittorrent.conf | grep -m 1 "WebUI\Port=${WEBUI_PORT}")
|
webui_port_exist=$(cat /config/qBittorrent/config/qBittorrent.conf | grep -m 1 "WebUI\Port=${WEBUI_PORT}")
|
||||||
|
Loading…
Reference in New Issue
Block a user