Only use getent if the command can be found.

This commit is contained in:
Jordan Bancino 2023-03-01 03:09:46 +00:00
parent 755d08946a
commit dd1b26bad8

View file

@ -244,7 +244,7 @@ recipe_patch() {
# If the user has not set their DISPLAY_NAME, try to deduce it
# from their system.
if [ -z "$DISPLAY_NAME" ]; then
if [ -z "$DISPLAY_NAME" ] && which getent > /dev/null 2>&1; then
DISPLAY_NAME=$(getent passwd "$USER" | cut -d ':' -f 5 | cut -d ',' -f 1)
fi