]> mj.ucw.cz Git - eval.git/blobdiff - bin/mo-get-users
The first bits of the contest GUI.
[eval.git] / bin / mo-get-users
index f2ed30fc0fb02751dc595267f4e7e49db51974e1..f85919ed8ec6b6d2c572465b1d93e0f294c40e96 100755 (executable)
@@ -7,9 +7,17 @@ fi
 set -e
 . config
 
-if [ "$1" = --full ] ; then
-       FORM='$1,$5'
+if [ -z "$CT_USER_LIST" ] ; then
+       if [ "$1" = --full ] ; then
+               FORM='$1,$5'
+       else
+               FORM='$1'
+       fi
+       awk -F: </etc/passwd "{ gsub(\",.*\",\"\",\$5); OFS=\"\t\"; if (\$3 >= $CT_UID_MIN && \$3 <= $CT_UID_MAX) print $FORM; }"
 else
-       FORM='$1'
+       if [ "$1" = --full ] ; then
+               cut -d '        ' -f 1,2 <$CT_USER_LIST
+       else
+               cut -d '        ' -f 1 <$CT_USER_LIST
+       fi
 fi
-awk -F: </etc/passwd "{ gsub(\",.*\",\"\",\$5); OFS=\"\t\"; if (\$3 >= $CT_UID_MIN && \$3 <= $CT_UID_MAX) print $FORM; }"