aboutsummaryrefslogtreecommitdiff
path: root/unifi-video
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2019-01-11 03:58:23 +0000
committerMike Crute <mike@crute.us>2019-01-11 03:58:23 +0000
commit9dea8c2e5af9c2275e49f452ab19c885c0bae58f (patch)
tree4d3f61588d27321c74b72b933b7893cd269a9432 /unifi-video
parent0a3db0288ef8c297e4e19421a0e1211650aba104 (diff)
downloaddockerfiles-9dea8c2e5af9c2275e49f452ab19c885c0bae58f.tar.bz2
dockerfiles-9dea8c2e5af9c2275e49f452ab19c885c0bae58f.tar.xz
dockerfiles-9dea8c2e5af9c2275e49f452ab19c885c0bae58f.zip
Conditionally add users and groups
Diffstat (limited to 'unifi-video')
-rwxr-xr-xunifi-video/entrypoint.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/unifi-video/entrypoint.sh b/unifi-video/entrypoint.sh
index e0740d1..f4974c4 100755
--- a/unifi-video/entrypoint.sh
+++ b/unifi-video/entrypoint.sh
@@ -19,9 +19,13 @@ fi
19 19
20cd ${BASEDIR} 20cd ${BASEDIR}
21 21
22# Create the user and group 22# Create the user and group if they don't exist
23addgroup -g ${UNIFI_GID} -S ${USERNAME} 23if ! grep "^${USERNAME}:" /etc/group 2>&1>/dev/null; then
24adduser -u ${UNIFI_UID} -S -h /var/lib/${USERNAME} -H -D -G ${USERNAME} ${USERNAME} 24 addgroup -g ${UNIFI_GID} -S ${USERNAME}
25fi
26if ! grep "^${USERNAME}:" /etc/passwd 2>&1>/dev/null; then
27 adduser -u ${UNIFI_UID} -S -h /var/lib/${USERNAME} -H -D -G ${USERNAME} ${USERNAME}
28fi
25 29
26# Update permissions on the root directories 30# Update permissions on the root directories
27chown ${USERNAME}:${USERNAME} \ 31chown ${USERNAME}:${USERNAME} \