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