X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=bin%2Fmo-install;h=8d7556c016678e80332946f2746a0b4e2a671568;hb=41ef8f74a24aa9b9fa230a4aa552b7883e8da1df;hp=cae344e4233c233e508b887400e33b04da0e21c4;hpb=1e23a4dea09e896cede5dd3182537ed8a7eb1ee5;p=moe.git diff --git a/bin/mo-install b/bin/mo-install index cae344e..8d7556c 100755 --- a/bin/mo-install +++ b/bin/mo-install @@ -1,50 +1,46 @@ -#!/bin/sh +#!/bin/bash [ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; } set -e . config +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 $H/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 )