usermod ${SYS_USER_UID:+--uid }"${SYS_USER_UID}" \
${SYS_USER_GROUPS:+--append --groups }"${SYS_USER_GROUPS}" \
--shell "${SYS_USER_SHELL}" \
- --home-dir "${SYS_USER_HOME}" \
+ --home "${SYS_USER_HOME}" \
"${SYS_USER_NAME}"
}
fi
local current_name=$(sys-user_getname "${SYS_USER_UID}")
- if [[ "${current_name}" != "${SYS_USER_NAME}" ]]; then
+ if [[ -n "${current_name}" ]] && \
+ [[ "${current_name}" != "${SYS_USER_NAME}" ]]; then
# This UID is already taken by another user, but this
# specific UID was not important (we checked in
# pkg_pretend), so fall back to an arbitrary one.