X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmo-install;h=8d7556c016678e80332946f2746a0b4e2a671568;hb=51e6d3494735a2f5ab576731d7c14ae535550573;hp=e4ad6f87242eae37637d2a4fc2607fe730959fa3;hpb=61d6e3a8ccf5b8378d8cb99b4d6d4e7e03a3b05a;p=eval.git diff --git a/bin/mo-install b/bin/mo-install index e4ad6f8..8d7556c 100755 --- a/bin/mo-install +++ b/bin/mo-install @@ -6,47 +6,41 @@ set -e make H=`pwd` + +# The eval directory cd $MO_ROOT +rm -rf eval +mkdir eval +chgrp $EVAL_GROUP eval +chmod 755 eval +cd eval # mo-eval home echo "Creating $EVAL_USER" -rm -rf ./$EVAL_USER -mkdir $EVAL_USER -cd $EVAL_USER +mkdir eval +cd eval cp -a $H/* . -mv bin/profile .profile chmod +x bin/* +if [ -d ~/.ssh ] ; then echo "Copying SSH configuration from ~/.ssh" ; cp -a ~/.ssh . ; fi cd .. -chown -R $EVAL_USER.$EVAL_GROUP $EVAL_USER -chmod 700 $EVAL_USER - -# mo-test home -for u in $TEST_USERS ; do - echo "Creating $u" - rm -rf ./$u - mkdir $u - chown $u.$EVAL_GROUP $u - chmod 770 $u - cp $EVAL_USER/bin/box $EVAL_USER/bin/box-$u - chown $u.$EVAL_GROUP $EVAL_USER/bin/box-$u - chmod 4550 $EVAL_USER/bin/box-$u - done - -# common +chown -R $EVAL_USER.$EVAL_GROUP eval +chmod 750 eval + +# testusers +( cd eval && bin/mo-create-testusers ) + +# mo-submit home +if [ -n "$REMOTE_SUBMIT" ] ; then + mkdir submit + if [ -d ~/.ssh ] ; then echo "Copying SSH configuration from ~/.ssh" ; cp -a ~/.ssh submit/ ; fi + ( cd $H && bin/mo-create-submit ) +fi + +# create public +cd $MO_ROOT echo "Creating public" rm -rf public mkdir public -cd public -cp -a $H/bin $H/config . -mkdir problems -cp -a $H/public/* bin/ -chmod +x bin/* -cd .. -chown -R $EVAL_USER.$EVAL_GROUP public -chmod 755 public - -# SSH keys (FIXME) -echo "Copying SSH keys" -mkdir $EVAL_USER/.ssh -cp ~mj/.ssh/authorized_keys $EVAL_USER/.ssh/ -chown -R $EVAL_USER $EVAL_USER/.ssh + +# populate public +( cd eval/eval ; bin/mo-create-public )