aboutsummaryrefslogtreecommitdiff
path: root/tools/etc/icpc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/etc/icpc')
-rwxr-xr-xtools/etc/icpc/installboca.sh4
-rwxr-xr-xtools/etc/icpc/setup.sh10
-rwxr-xr-xtools/etc/icpc/update.sh8
3 files changed, 17 insertions, 5 deletions
diff --git a/tools/etc/icpc/installboca.sh b/tools/etc/icpc/installboca.sh
index 427f73c..bea085c 100755
--- a/tools/etc/icpc/installboca.sh
+++ b/tools/etc/icpc/installboca.sh
@@ -147,7 +147,6 @@ chmod 755 boca-$bocaver/tools/.htaccess
cp boca-$bocaver/tools/.htaccess boca-$bocaver/doc/.htaccess
cp boca-$bocaver/tools/.htaccess boca-$bocaver/old/.htaccess
cp boca-$bocaver/tools/.htaccess boca-$bocaver/src/private/.htaccess
-cp boca-$bocaver/tools/.htaccess boca-$bocaver/src/webcast/.htaccess
chmod -R 770 boca-$bocaver/src/private
chmod -R 775 boca-$bocaver/src/balloons
@@ -184,6 +183,7 @@ fi
echo "=================================================="
echo "=================== SERVER SETUP ==============="
echo "=================================================="
+ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini 2>/dev/null
OK=n
echo "You can run at anytime later the script /etc/icpc/becomeserver.sh to prepare the computer to be the BOCA server"
@@ -213,3 +213,5 @@ cat > /etc/apache2/conf.d/boca <<EOF
</Directory>
Alias /boca $basedir/boca/src
EOF
+
+ln -s /etc/apache2/conf.d/boca /etc/apache2/conf-enabled/boca.conf
diff --git a/tools/etc/icpc/setup.sh b/tools/etc/icpc/setup.sh
index a854581..da5a334 100755
--- a/tools/etc/icpc/setup.sh
+++ b/tools/etc/icpc/setup.sh
@@ -4,7 +4,7 @@ if [ ! -x /etc/icpc/bocaserver.sh ]; then
OK=1
while [ "$OK" != "0" ]; do
IP=`zenity --title="Setting up the BOCA server IP number" --text="Enter the IP address of the server (format x.y.w.z)\n\
-If this is supposed to be the server, then leave it empty" --width=500 --height=100 --entry`
+If this is supposed to be the server, then leave it empty\nIf there are multiple servers, separate IPs by a semi-colon ;" --width=500 --height=100 --entry`
[ "$IP" == "" ] && IP=LOCAL
zenity --title="IP confirmation" --text="The chosen IP is $IP\nDo you confirm?" --question
OK=$?
@@ -13,8 +13,12 @@ If this is supposed to be the server, then leave it empty" --width=500 --height=
IP=127.0.0.1
BOCASERVER=0/0
fi
- echo "BOCASERVER=$IP" > /etc/icpc/bocaserver.sh
- echo "$IP boca boca" >> /etc/hosts
+ FIRSTBOCA=`echo $IP | cut -d';' -f1`
+ echo "BOCASERVER=$FIRSTBOCA" > /etc/icpc/bocaserver.sh
+ if [ "`echo $IP | cut -d';' -f2-`" != "" ]; then
+ echo "BOCASERVERS=`echo $IP | cut -d';' -f2-`" >> /etc/icpc/bocaserver.sh
+ fi
+ echo "$FIRSTBOCA boca boca" >> /etc/hosts
chmod 755 /etc/icpc/bocaserver.sh
fi
. /etc/icpc/bocaserver.sh
diff --git a/tools/etc/icpc/update.sh b/tools/etc/icpc/update.sh
index f6b4bb6..78a87bb 100755
--- a/tools/etc/icpc/update.sh
+++ b/tools/etc/icpc/update.sh
@@ -2,7 +2,12 @@
if [ "`id -u`" != "0" ]; then
echo "Script must run as root"
fi
-wget -O /tmp/update.sh "http://www.ime.usp.br/~cassio/boca/update.sh"
+if [ "$1" == "" ]; then
+ wget -O /tmp/update.sh "http://www.ime.usp.br/~cassio/boca/download.php?filename=update.sh"
+else
+ wget -O /tmp/update.sh "http://www.ime.usp.br/~cassio/boca/download.php?filename=update.$1.sh"
+fi
+chmod 700 /tmp/update.sh 2>/dev/null
if [ $? != 0 ]; then
echo "ERROR DOWNLOADING UPDATE"
exit 1
@@ -11,4 +16,5 @@ echo ">>>>>>>>>>"
echo ">>>>>>>>>> Running update script"
echo ">>>>>>>>>>"
/tmp/update.sh
+rm -f /tmp/update.sh
exit $?