summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Legoll <vincent.legoll@gmail.com>2020-05-17 19:17:05 +0200
committerGuix Patches Tester <>2020-05-24 21:33:31 +0100
commitc50cfc6a7980b1f10e6ac759f964152ae397f986 (patch)
treea970d7157f521359d18fec10a4f5bc5194175c0c
parent2ae11cd0a43bfd8c0106afc620c2e5be1cecef78 (diff)
downloadpatches-c50cfc6a7980b1f10e6ac759f964152ae397f986.tar
patches-c50cfc6a7980b1f10e6ac759f964152ae397f986.tar.gz
guix-install.sh: Use getent for both user & group presence checking.
* etc/guix-install.sh (sys_create_build_user): Use getent instead of id to check presence of users, use bare getent call with output redirection for group check.
-rwxr-xr-xetc/guix-install.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index bf15aede21..30f2780def 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -297,7 +297,7 @@ sys_create_build_user()
_debug "--- [ $FUNCNAME ] ---"
- if [ $(getent group guixbuild) ]; then
+ if getent group guixbuild >/dev/null 2>&1; then
_msg "${INF}group guixbuild exists"
else
groupadd --system guixbuild
@@ -305,7 +305,7 @@ sys_create_build_user()
fi
for i in $(seq -w 1 10); do
- if id "guixbuilder${i}" &>/dev/null; then
+ if getent passwd "guixbuilder${i}" >/dev/null 2>&1; then
_msg "${INF}user is already in the system, reset"
usermod -g guixbuild -G guixbuild \
-d /var/empty -s "$(which nologin)" \