_shell=$1
[ -z "$_shell" ] && return 1
+ # /usr/sbin/nologin is a special case; it needs to be handled
+ # before the cat | while loop, since a 'return' from within
+ # a subshell will not terminate the function's execution, and
+ # the path to the nologin shell might be printed out twice.
+ #
+ if [ "$_shell" = "${NOLOGIN}" -o \
+ "$_shell" = "${NOLOGIN_PATH}" ]; then
+ echo ${NOLOGIN_PATH}
+ return 0;
+ fi
+
cat ${ETCSHELLS} |
while read _path _junk ; do
case "$_path" in
esac
done
- # /usr/sbin/nologin is a special case
- if [ "$_shell" = "${NOLOGIN}" -o \
- "$_shell" = "${NOLOGIN_PATH}" ]; then
- echo ${NOLOGIN_PATH}
- return 0;
- fi
-
return 1
}
# allocates one if it is not specified.
#
get_uid() {
- uuid=${uidstart}
+ if [ -z "$uuid" ]; then
+ uuid=${uidstart}
+ fi
+
_input=
_prompt=
while read -r fileline ; do
case "$fileline" in
\#*|'')
- return 0
;;
esac
return 0
}
-#### END SUBROUTINE DEFENITION ####
+#### END SUBROUTINE DEFINITION ####
THISCMD=`/usr/bin/basename $0`
DEFAULTSHELL=/bin/sh