1 |
Hi, |
2 |
|
3 |
|
4 |
> + # update the comment |
5 |
> + case ${CHOST} in |
6 |
> + *-freebsd*|*-dragonfly*) |
7 |
> + pw usermod "${euser}" -c "${ecomment}" && return 0 |
8 |
> + [[ $? == 8 ]] && eerror "${euser} is in use, cannot update comment" |
9 |
> + eerror "There was an error when attempting to update the comment for ${euser}" |
10 |
> + eerror "Please update it manually on your system:" |
11 |
> + eerror "\t pw usermod \"${euser}\" -c \"${ecomment}\"" |
12 |
> + ;; |
13 |
> + |
14 |
> + *) |
15 |
> + usermod -c "${ecomment}" "${euser}" && return 0 |
16 |
> + [[ $? == 8 ]] && eerror "${euser} is in use, cannot update comment" |
17 |
> + eerror "There was an error when attempting to update the comment for ${euser}" |
18 |
> + eerror "Please update it manually on your system (as root):" |
19 |
> + eerror "\t usermod -c \"${ecomment}\" \"${euser}\"" |
20 |
> + ;; |
21 |
> + esac |
22 |
> +} |
23 |
> + |
24 |
> fi |
25 |
|
26 |
|
27 |
Those error messages are duplicate and can move to after the case. |
28 |
|
29 |
You should probably also explicitly return with an error if the case |
30 |
drops through. |
31 |
|
32 |
Kind Regards, |
33 |
Jaco |