summaryrefslogtreecommitdiffstats
path: root/process.sh
blob: 865a5c2cb16c66074fbaeca14c9fa8b6ed979b2c (plain)
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
#! /bin/bash

for name in `find . -regextype posix-extended -iregex './downloads/.*(linux.7z|.exe)'`; do
    if [[ "$name" =~ "linux.7z" ]]; then
        if [[ "$name" =~ "velo" ]]; then
	    mapname=`basename $name linux.7z | cut -c 5-`
    	    img=maps/velo-$mapname.img
        else 
	    mapname=`basename $name linux.7z | cut -c 4-`
    	    img=maps/mtb-$mapname.img
	fi
    else
        if [[ "$name" =~ "velo" ]]; then
	    mapname=`basename $name .exe | cut -c 5-`
    	    img=maps/velo-$mapname.img
        else 
	    mapname=`basename $name .exe | cut -c 4-`
    	    img=maps/mtb-$mapname.img
	fi
    fi

    [ -f $img ] && continue

    bash ./generate.sh "$name" "$mapname" "$img"
    if [ $? -ne 0 ]; then
        break
    fi
done