evalLog.sh 1.1 KB
Newer Older
Juon Kawakami's avatar
init  
Juon Kawakami committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
. $(dirname $0)/config.sh

LOGFILE=$(readlink -f $1)
MAP=$2
TEAM=$3
MAP_EVALDIR=$HOME/$EVALDIR/$MAP

mkdir -p $MAP_EVALDIR/$TEAM
cd $MAP_EVALDIR

if [[ $LOGFILE == *.gz ]]; then
    echo "logfile is gzipped: ${LOGFILE%.gz}"
    LOGFILE_GZ=$LOGFILE
    LOGFILE=${LOGFILE%.gz}
    if [ ! -f $LOGFILE ]; then
        gunzip -c $LOGFILE_GZ > $LOGFILE
    fi;

elif [[ $LOGFILE == *.7z ]]; then
    echo "logfile is 7zipped: ${LOGFILE%.7z}"
    LOGFILE_7Z=$LOGFILE
    LOGFILE=${LOGFILE%.7z}

    if [ ! -f $LOGFILE ]; then
        7za e $LOGFILE_7Z
    fi;
fi;


cd $HOME/$KERNELDIR/boot
./logextract.sh $LOGFILE $MAP_EVALDIR/$TEAM
cd $MAP_EVALDIR

for screen in $TEAM/*.png; do
    tn=${screen%.png}-tn.jpg
    convert -format jpg -thumbnail 100x75 -strip -quality 95 PNG8:"$screen" "$tn"
done
if [ ! -f snapshot-init.png ]; then
    cp $TEAM/snapshot-init.png snapshot-init.png
    convert -format png -thumbnail 400x300 -strip -quality 95 PNG8:snapshot-init.png snapshot-init-small.png
fi

echo "Final score is: $(cat $TEAM/final-score.txt)"

echo "Rebuilding summary page for $RUNNING_MAP"

mapSummary.sh $MAP