]> mj.ucw.cz Git - moe.git/blob - bin/mo-get-users
Use `char *' for all strings instead of `byte *'.
[moe.git] / bin / mo-get-users
1 #!/bin/bash
2
3 if [ "$1" = --help ] ; then
4         echo "Usage: mo-get-users [--full]"
5 fi
6 [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
7 set -e
8 . config
9
10 if [ -z "$CT_USER_LIST" ] ; then
11         if [ "$1" = --full ] ; then
12                 FORM='$1,$5'
13         else
14                 FORM='$1'
15         fi
16         awk -F: </etc/passwd "{ gsub(\",.*\",\"\",\$5); OFS=\"\t\"; if (\$3 >= $CT_UID_MIN && \$3 <= $CT_UID_MAX) print $FORM; }"
17 else
18         if [ "$1" = --full ] ; then
19                 cut -d '        ' -f 1,2 <$CT_USER_LIST
20         else
21                 cut -d '        ' -f 1 <$CT_USER_LIST
22         fi
23 fi