aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Ribas <brunoribas@gmail.com>2016-09-16 17:18:05 +0000
committerBruno Ribas <brunoribas@gmail.com>2016-09-16 17:18:48 +0000
commit8a24150618cbecbb1c5556a6a5bec7d321c5aee5 (patch)
tree153527edb8353866fac194b9e4ce1f6d7e67f6e6
parentd9567a1099d89aa02b792fb1db3d08798d63ec3e (diff)
downloadboca-8a24150618cbecbb1c5556a6a5bec7d321c5aee5.tar.gz
boca-8a24150618cbecbb1c5556a6a5bec7d321c5aee5.zip
Added tools/boca-autojudge.sh
This script is defined as a front end to run the autojudging.php script. It will not automatically run autojudge in background. Signed-off-by: Bruno Ribas <brunoribas@gmail.com>
-rw-r--r--tools/boca-autojudge.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/boca-autojudge.sh b/tools/boca-autojudge.sh
new file mode 100644
index 0000000..50acef7
--- /dev/null
+++ b/tools/boca-autojudge.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# /////////////////////////////////////////////////////////////////////////////
+# //BOCA Online Contest Administrator
+# // Copyright (C) 2016- by BOCA Development Team (bocasystem@gmail.com)
+# //
+# // This program is free software: you can redistribute it and/or modify
+# // it under the terms of the GNU General Public License as published by
+# // the Free Software Foundation, either version 3 of the License, or
+# // (at your option) any later version.
+# //
+# // This program is distributed in the hope that it will be useful,
+# // but WITHOUT ANY WARRANTY; without even the implied warranty of
+# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# // GNU General Public License for more details.
+# // You should have received a copy of the GNU General Public License
+# // along with this program. If not, see <http://www.gnu.org/licenses/>.
+# /////////////////////////////////////////////////////////////////////////////
+# // Last modified 15/Sep/2016 by brunoribas@utfpr.edu.br
+
+
+if ! whoami |grep -q root; then
+ echo "$0 must be run as root"
+ exit 1
+fi
+
+if [[ ! -e /bocajail ]]; then
+ echo "Bocajail not found. Please run boca-createjail"
+ exit 1
+fi
+
+. /etc/boca.conf
+
+if [[ "x$bdserver" == "x" && "x$bdcreated" == "x" ]];then
+ if grep dbhost $bocadir/src/private/conf.php|grep -q localhost;then
+ echo "It was found no evidence that this machine is running a BOCA BD"
+ echo "Please consider running 'boca-config-dbhost' before"
+ exit 2
+ fi
+fi
+
+cd $bocadir/src/private
+php autojudging.php