aboutsummaryrefslogtreecommitdiff
path: root/tools/etc/icpc/setup.sh
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2015-08-28 09:31:34 +0000
committercassio <cassiopc@gmail.com>2015-08-28 09:31:34 +0000
commit56b10a617339563cda2c761e77b3acb96a1b084c (patch)
treeb0856564f7652ec2940aa6f0595cef1c7b73b52a /tools/etc/icpc/setup.sh
parent2a185532e3a0acf9e37e601fc71c148510dd36a7 (diff)
downloadboca-56b10a617339563cda2c761e77b3acb96a1b084c.tar.gz
boca-56b10a617339563cda2c761e77b3acb96a1b084c.zip
small bug fixes
Diffstat (limited to 'tools/etc/icpc/setup.sh')
-rwxr-xr-xtools/etc/icpc/setup.sh10
1 files changed, 7 insertions, 3 deletions
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