From: Simon McVittie Date: Fri, 12 May 2023 15:19:38 +0000 (+0100) Subject: CI: Make creation of user idempotent X-Git-Tag: dbus-1.15.6~15^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1712683ad344029f78675d00692f75d7f0f5cc2;p=thirdparty%2Fdbus.git CI: Make creation of user idempotent Signed-off-by: Simon McVittie --- diff --git a/tools/ci-install.sh b/tools/ci-install.sh index c5131c374..2afcd789b 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