Update preinst

fix installation failed with exit code 9
This commit is contained in:
Galen007 2025-12-03 12:55:30 +01:00 committed by GitHub
parent 991d25f628
commit 84c790d1cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,7 +22,7 @@ add_user() {
declare -r descr="${4:-No description}"
declare -r shell="${5:-/bin/false}"
if ! getent passwd | grep -q "^$user:"; then
if ! (getent passwd ; true) | grep -q "^$user:"; then
echo "Creating system user: $user in $group with $descr and shell $shell"
useradd $uid_flags --gid $group --no-create-home --system --shell $shell -c "$descr" $user
fi
@ -39,7 +39,7 @@ add_group() {
declare -r gid_flags="--gid $gid"
fi
if ! getent group | grep -q "^$group:" ; then
if ! (getent group; true) | grep -q "^$group:" ; then
echo "Creating system group: $group"
groupadd $gid_flags --system $group
fi