aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/boca-auth-runs16
-rw-r--r--tools/control-machines.sh48
2 files changed, 41 insertions, 23 deletions
diff --git a/tools/boca-auth-runs b/tools/boca-auth-runs
index b4a3d8f..a7e32bf 100755
--- a/tools/boca-auth-runs
+++ b/tools/boca-auth-runs
@@ -5,9 +5,6 @@ if [ "`id -u`" != "0" ]; then
exit 1
fi
-if [ "$BOCASERVER" == "" ]; then
- BOCASERVER=50.116.19.221
-fi
user="$1"
if [ "$user" == "" ]; then
echo "parameter user missing. Usage: $0 <user> [<optional-server-address>]"
@@ -15,7 +12,20 @@ if [ "$user" == "" ]; then
fi
if [ "$2" != "" ]; then
BOCASERVER=$2
+else
+ if [[ ! -e /etc/bocaip ]] ; then
+ echo "O IP do servidor boca nao configurado. Usando bombonera.org"
+ BOCASERVER=50.116.19.221
+ else
+ source /etc/bocaip
+ BOCASERVER=$BOCAIP
+ fi
fi
+if [ "$BOCASERVER" == "" ]; then
+ echo "BOCA server not defined. Aborting"
+ exit 1
+fi
+
echo "Server at $BOCASERVER"
read -s -p "Password: " pass
diff --git a/tools/control-machines.sh b/tools/control-machines.sh
index 2b52e33..5997e64 100644
--- a/tools/control-machines.sh
+++ b/tools/control-machines.sh
@@ -35,26 +35,34 @@ else
fi
fi
+if [ 0 == 1 ]; then
+ ###example of codes
+ sitename='imeu'
+ password='password'
+ ress=`echo -n "$password" | sha256sum - | cut -f1 -d' '`
+ res=`echo -n "${password}${ress}${password}" | sha256sum - | cut -f1 -d' '`
+ echo $sitename $ress $res 0
###example of generating score.sep
###First Surname:email@gmail.com:Sao Paulo:SP:spsp:46:48479:146:qrw3
-# #!/bin/bash
-# while read lin; do
-# prefix="`echo -n $lin | cut -d':' -f8`"
-# prenam="`echo -n $lin | cut -d':' -f5`"
-# echo "$prenam ${prefix}000/${prefix}399/1 # /^team${prenam}/ /^staff${prenam}/ /^score${prenam}/"
-# echo "${prenam}ccl ${prefix}000/${prefix}500/1 # /^staff${prenam}/ /^teamccl${prenam}/ /^judge/"
-# done
-# #!/bin/bash
-# i=1
-# j=1
-# k=1
-# while [ $i -le 49 ]; do
-# let "jj = $j + 1"
-# let "ii = $i - 1"
-# let "ff = $ii * 100 + 50000"
-# let "gg = $i * 100 + 49999"
-# echo "sede$i $ff/$gg/1 # /^team${j}\$/ /^team${jj}\$/ /^staff${i}\$/"
-# let "i = $i + 1"
-# let "j = $j + 2"
-# done
+ #!/bin/bash
+ while read lin; do
+ prefix="`echo -n $lin | cut -d':' -f8`"
+ prenam="`echo -n $lin | cut -d':' -f5`"
+ echo "$prenam ${prefix}000/${prefix}399/1 # /^team${prenam}/ /^staff${prenam}/ /^score${prenam}/"
+ echo "${prenam}ccl ${prefix}000/${prefix}500/1 # /^staff${prenam}/ /^teamccl${prenam}/ /^judge/"
+ done
+ #!/bin/bash
+ i=1
+ j=1
+ k=1
+ while [ $i -le 49 ]; do
+ let "jj = $j + 1"
+ let "ii = $i - 1"
+ let "ff = $ii * 100 + 50000"
+ let "gg = $i * 100 + 49999"
+ echo "sede$i $ff/$gg/1 # /^team${j}\$/ /^team${jj}\$/ /^staff${i}\$/"
+ let "i = $i + 1"
+ let "j = $j + 2"
+ done
+fi