3 [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
10 eval) uid=$EVAL_UID_MIN;;
11 users) uid=$CT_UID_MIN;;
12 *) echo "Usage: $0 [eval|users]!"; exit 1;;
15 >>etcshadow >>etcpasswd >>etcgroup
16 expire=$((`date +%s` / 86400 - 1))
20 echo -n Enter password for evaluation users:
22 passwd=`echo $passwd | bin/md5crypt`
26 echo $EVAL_USER:x:$uid:$gid:MO Evaluator:$MO_ROOT/eval/eval:/bin/bash >> etcpasswd
27 echo $EVAL_USER:$passwd:$expire:0:99999:7::: >> etcshadow
28 echo $EVAL_GROUP:x:$gid: >> etcgroup
29 echo $TEST_GROUP:x:$tgid:$EVAL_USER >> etcgroup
31 if [ -n "$REMOTE_SUBMIT" ] ; then
33 echo $REMOTE_SUBMIT_USER:x:$uid:$rgid:MO Submitter:$MO_ROOT/eval/submit:/bin/bash >> etcpasswd
34 echo $REMOTE_SUBMIT_USER:$passwd:$expire:0:99999:7::: >> etcshadow
35 echo $REMOTE_SUBMIT_GROUP:x:$rgid: >> etcgroup
39 for tester in $TEST_USERS; do
40 echo $tester:x:$tuid:$tgid:MO Tester `expr $tuid - $uid`:$MO_ROOT/eval/$tester:/bin/bash >> etcpasswd
41 echo $tester:$passwd:$expire:0:99999:7::: >> etcshadow
47 # if [ -f logins.tex ]; then echo "File logins.tex exists! Bailing out!"; exit 1; fi
48 cat > logins.tex <<- EOF
50 \\voffset=-1.5cm\\vsize=280mm\\hoffset=-0.75cm\\advance\\hsize by 3cm
51 \\raggedright\\parindent=0pt
52 \\font\next=cstt17\next
53 \\def\\user#1#2{\\vbox to 4.5cm{\\hsize=6cm\\vss\\vss{\\font\\next=csti17\\next Contest, day 1}\\vss\\vss#1\\vss#2\\vss\\vss}}
57 bin/mo-get-users --full | while read user name; do
58 passwd=`apg -n1 -m6 -Mncl | cut -d" " -f1 | tr l1O0 '@*?-' `
59 passwd_md5=`echo $passwd | bin/md5crypt`
60 echo $user:x:$uid:$uid:$name:$MO_ROOT/users/$user/$user:/bin/bash >> etcpasswd
61 echo $user:x:$uid: >> etcgroup
62 echo $user:$passwd_md5:`expr \`date +%s\` / 86400 - 1`:0:99999:7::: >> etcshadow
63 echo "\\user{$user}{$passwd}" >> logins.tex
67 cat >> logins.tex <<- EOF