diff options
author | Simon McVittie <smcv@collabora.com> | 2023-05-12 16:19:38 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2023-05-12 17:47:25 +0100 |
commit | b1712683ad344029f78675d00692f75d7f0f5cc2 (patch) | |
tree | 52e35f6f88051bfa75dd97685c9e3227f9807da1 | |
parent | a6da40b2066a783ed8a1f6a48e67671797aa825c (diff) | |
download | dbus-b1712683ad344029f78675d00692f75d7f0f5cc2.tar.gz |
CI: Make creation of user idempotent
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rwxr-xr-x | tools/ci-install.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/ci-install.sh b/tools/ci-install.sh index c5131c37..2afcd789 100755 --- a/tools/ci-install.sh +++ b/tools/ci-install.sh @@ -286,8 +286,10 @@ case "$ci_distro" in if [ "$ci_in_docker" = yes ]; then # Add the user that we will use to do the build inside the # Docker container, and let them use sudo - useradd -m user - passwd -ud user + if ! getent passwd user >/dev/null; then + useradd -m user + passwd -ud user + fi echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopasswd chmod 0440 /etc/sudoers.d/nopasswd fi |