From 9e75d473525446d0961a7567bcb8a1e672949df8 Mon Sep 17 00:00:00 2001 From: cassiopc Date: Sat, 20 Oct 2012 14:24:23 +0200 Subject: fixed team login issue, included empty default options in submission tab, included extra-packages and links in ICPC Linux --- boca-1.5.1/tools/etc/icpc/becomeserver.sh | 10 ++++++++++ boca-1.5.1/tools/etc/icpc/doclean.sh | 5 +++-- boca-1.5.1/tools/etc/icpc/installboca.sh | 26 +++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 5 deletions(-) (limited to 'boca-1.5.1/tools/etc') diff --git a/boca-1.5.1/tools/etc/icpc/becomeserver.sh b/boca-1.5.1/tools/etc/icpc/becomeserver.sh index 33bebea..4de2084 100755 --- a/boca-1.5.1/tools/etc/icpc/becomeserver.sh +++ b/boca-1.5.1/tools/etc/icpc/becomeserver.sh @@ -95,6 +95,16 @@ for i in `ls /etc/postgresql/*/main/pg_hba.conf`; do echo "==> IF YOU HAVE MULTIPLE AUTOJUDGE MACHINES, WRITE ONE LINE FOR EACH IP ADDRESS THERE IN THE FILE <==" echo "############" echo "host bocadb bocauser 0/0 md5" >> $i + else + echo "############" + echo "IT SEEMS YOU ALREADY HAVE MODIFIED THE FILE $i WITH BOCA'S INFORMATION" + echo "I WOULD USE THE LINE:" + echo "" + echo -e "echo \"host bocadb bocauser 0/0 md5\" >> $i" + echo "" + echo "to give access to the database to other computers, but" + echo ">>> I'M NOT DOING IT -- PLEASE CHECK IT <<<" + echo "############" fi done diff --git a/boca-1.5.1/tools/etc/icpc/doclean.sh b/boca-1.5.1/tools/etc/icpc/doclean.sh index ea7d517..40b49c1 100755 --- a/boca-1.5.1/tools/etc/icpc/doclean.sh +++ b/boca-1.5.1/tools/etc/icpc/doclean.sh @@ -4,11 +4,11 @@ if [ -f /home/icpc/.cleandisk.sh ]; then rm -rf /home/icpc find /home -user icpc -delete if [ -x /usr/bin/makepasswd ]; then - pass=`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-` + pass=`echo -n icpc | /usr/bin/makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-` pass=\$`echo $pass` id -u icpc >/dev/null 2>/dev/null if [ $? != 0 ]; then - useradd -d /home/icpc -m -p "$pass" -s /bin/bash -g users icpc + useradd -d /home/icpc -k /etc/skel -m -p "$pass" -s /bin/bash -g users icpc else usermod -d /home/icpc -p "$pass" -s /bin/bash -g users icpc fi @@ -23,6 +23,7 @@ if [ ! -d /home/icpc ]; then mv /home/skel /home/icpc fi chown -R icpc.users /home/icpc +chmod -R u+rwx /home/icpc fi cd - >/dev/null exit 0 diff --git a/boca-1.5.1/tools/etc/icpc/installboca.sh b/boca-1.5.1/tools/etc/icpc/installboca.sh index 8f35e74..d1cb842 100755 --- a/boca-1.5.1/tools/etc/icpc/installboca.sh +++ b/boca-1.5.1/tools/etc/icpc/installboca.sh @@ -1,4 +1,8 @@ #!/bin/bash +if [ "`id -u`" != "0" ]; then + echo "Script must run as root" +fi + di=`date +%s` echo "===================================================" echo "=================== obtaining BOCA ===============" @@ -15,7 +19,7 @@ bocaver=`cat /tmp/.boca.tmp` else bocaver=$1 fi -echo "Looking for BOCA version $bocaver from http://www.ime.usp.br/~cassio/boca/" + if [ "$2" == "" ]; then basedir=/var/www else @@ -27,6 +31,16 @@ exit 1 fi fi +OK=y +read -p "I will install boca at $basedir is it correct (otherwise, run this script as: $0 $bocaver to choose the place) [Y/n]? " OK +if [ "$OK" == "y" -o "$OK" == "Y" ]; then +echo "Install directory is $basedir" +else +echo "Aborted" +exit 1 +fi + +echo "Looking for BOCA version $bocaver from http://www.ime.usp.br/~cassio/boca/" cd $basedir rm -f boca-$bocaver.tgz wget -O boca-$bocaver.tgz "http://www.ime.usp.br/~cassio/boca/download.php?filename=boca-$bocaver.tgz" @@ -55,7 +69,11 @@ echo "=================== EXTRACTING BOCA ===============" echo "=====================================================" OK=x -if [ -f boca-$bocaver.$di/src/private/conf.php ]; then +conffile=boca/src/private/conf.php +if [ ! -f $conffile ]; then +conffile=boca-$bocaver.$di/src/private/conf.php +fi +if [ -f $conffile ]; then echo "OLD CONFIG FILE EXISTS" OK=x while [ "$OK" != "y" -a "$OK" != "n" ]; do @@ -65,6 +83,8 @@ if [ -f boca-$bocaver.$di/src/private/conf.php ]; then if [ "$OK" == "n" ]; then echo "You probably need to update the new file boca-$bocaver/src/private/conf.php with the correct passwords - PLEASE CHECK IT - NOT DONE AUTOMATICALLY" fi +else + echo "OLD Config file not found -- you must set up the new private/conf.php file properly" fi apacheuser= @@ -83,7 +103,7 @@ chmod -R g+rx,u+rwx boca-$bocaver/ chmod 600 boca-$bocaver/src/private/*.php [ -f boca-$bocaver.$di/src/private/remotescores/otherservers ] && cp -f boca-$bocaver.$di/src/private/remotescores/otherservers boca-$bocaver/src/private/remotescores/otherservers if [ "$OK" == "y" ]; then - cp -f boca-$bocaver.$di/src/private/conf.php boca-$bocaver/src/private/conf.php + cp -f $conffile boca-$bocaver/src/private/conf.php fi chmod 700 boca-$bocaver/tools/*.sh -- cgit v1.2.3