On 6/11/19 12:23 PM, Michał Górny wrote:
>
> +# @FUNCTION: user_get_nologin
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Find an appropriate 'nologin' shell for the platform, and output
> +# its path.
> +user_get_nologin() {
This isn't a great name for this function, because it doesn't have
anything to do with the user being added. How about
userland_get_nologin? Then it could take the userland as an argument...
> + case ${USERLAND} in
> + GNU) eshell="/bin/false" ;;
to eliminate that dependency on the global variable. In other words, the
above could become "case $1..." to make the function self-contained.
> + eshell=$(user_get_nologin)
Then this would have to become
eshell=$(userland_get_nologin "${USERLAND}")