X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmo-install;h=8d7556c016678e80332946f2746a0b4e2a671568;hb=91f44a34afc80be20a8f9de9b07e9b0099275fe8;hp=e362614bf789ded5029929f0b09f567b44f4af55;hpb=283214723416710aaf5d94b9c1e3527fa6f1208e;p=moe.git diff --git a/bin/mo-install b/bin/mo-install index e362614..8d7556c 100755 --- a/bin/mo-install +++ b/bin/mo-install @@ -1,47 +1,46 @@ -#!/bin/sh +#!/bin/bash -[ -f config ] || ( echo "Missing config file, check cwd." ; exit 1 ) +[ -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 -echo "Creating common" -rm -rf common -mkdir common -cd common -cd .. -chown -R $EVAL_USER.$EVAL_GROUP common -chmod 750 $EVAL_USER - -# 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 +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 + +# populate public +( cd eval/eval ; bin/mo-create-public )