mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-24 20:35:42 +00:00
Allow the for changing of the UID/GID of the user/group pihole
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
@@ -28,7 +28,8 @@ RUN apk add --no-cache \
|
||||
procps \
|
||||
ncurses \
|
||||
binutils \
|
||||
tzdata
|
||||
tzdata \
|
||||
shadow
|
||||
|
||||
ADD https://ftl.pi-hole.net/macvendor.db /macvendor.db
|
||||
COPY crontab.txt /crontab.txt
|
||||
|
||||
19
src/start.sh
19
src/start.sh
@@ -24,6 +24,25 @@ echo " [i] Starting docker specific checks & setup for docker pihole/pihole"
|
||||
|
||||
# Initial checks
|
||||
# ===========================
|
||||
|
||||
# If PIHOLE_UID is set, modify the pihole user's id to match
|
||||
if [ -n "${PIHOLE_UID}" ]; then
|
||||
currentId=$(id -u ${username})
|
||||
[[ ${currentId} -eq ${PIHOLE_UID} ]] && return
|
||||
|
||||
echo " [i] Changing ID for user: pihole (${currentId} => ${PIHOLE_UID})"
|
||||
usermod -o -u ${PIHOLE_UID} pihole
|
||||
fi
|
||||
|
||||
# If PIHOLE_GID is set, modify the pihole group's id to match
|
||||
if [ -n "${PIHOLE_GID}" ]; then
|
||||
currentId=$(id -g pihole)
|
||||
[[ ${currentId} -eq ${PIHOLE_GID} ]] && return
|
||||
|
||||
echo " [i] Changing ID for group: pihole (${currentId} => ${PIHOLE_GID})"
|
||||
groupmod -o -g ${PIHOLE_GID} pihole
|
||||
fi
|
||||
|
||||
fix_capabilities
|
||||
# validate_env || exit 1
|
||||
ensure_basic_configuration
|
||||
|
||||
Reference in New Issue
Block a user