aboutsummaryrefslogtreecommitdiffstats
path: root/checkupdate.sh
blob: f5e84388ee6eb7868ed65ab01150d687240a243e (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash


orev=$(cat rev.txt)
nrev=$(wget http://www.mayor.hu/download/current/md5sum -O - | grep 'Revision' | cut -d ' ' -f 2)

pd=$(pwd)

if [ "$nrev" -gt "$orev" ]; then 

	git checkout MaYor-dev

	wget http://www.mayor.hu/download/current/rev.txt -O rev.txt
	wget http://www.mayor.hu/download/current/md5sum  -O mayor-orig/md5sum

	cd /tmp

	for i in $(cat "$pd"/mayor-orig/md5sum | tail -n+2 | cut -d ' ' -f 3); do
		
		j=$(echo $i | sed -e 's/-rev.*//g')
		wget http://www.mayor.hu/download/current/"$i"
		if [ ! -d "$pd/mayor-orig/$i" ]; then
			mkdir "$pd"/mayor-orig/"$j"
		fi
		tar -xzvf /tmp/"$i" -C "$pd"/mayor-orig/"$j"

	done

	
	cd $pd
	cp -f 'rev.txt' 'mayor-orig/rev.txt'
	cp -rf 'mayor-installer/mayor-installer-orig/log/' 'mayor-installer/mayor-installer-jav/'
	cp -rf 'mayor-installer/mayor-installer-orig/log/' 'mayor-installer/mayor-installer-for-fcgi/'

	git add --all
	git commit -a -m "Rev: $nrev"
	git tag -a "rev$nrev" -m "Rev: $nrev"

	git checkout master
        
fi