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
+ cat $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; }"
CT_UID_MIN=65100
CT_UID_MAX=65199
+# If the contestants are not present in /etc/passwd on the evaluating machine,
+# we need a list of them (username<tab>fullname).
+#CT_USER_LIST=userlist
+
# Test user for sandboxing
TEST_USER=${TEST_USER:mo-test1}