aboutsummaryrefslogtreecommitdiffstats
path: root/checkupdate.sh
diff options
context:
space:
mode:
Diffstat (limited to 'checkupdate.sh')
-rwxr-xr-xcheckupdate.sh48
1 files changed, 25 insertions, 23 deletions
diff --git a/checkupdate.sh b/checkupdate.sh
index c79ce5f8..f094e685 100755
--- a/checkupdate.sh
+++ b/checkupdate.sh
@@ -3,40 +3,42 @@
git checkout MaYor-dev
-orev=$(cat rev.txt)
-nrev=$(wget http://www.mayor.hu/download/current/md5sum -O - | grep 'Revision' | cut -d ' ' -f 2)
+if [ $? == 0 ]; then
+ orev=$(cat rev.txt)
+ nrev=$(wget http://www.mayor.hu/download/current/md5sum -O - | grep 'Revision' | cut -d ' ' -f 2)
-pd=$(pwd)
+ pd=$(pwd)
-if [ "$nrev" -gt "$orev" ]; then
+ if [ "$nrev" -gt "$orev" ]; then
- wget http://www.mayor.hu/download/current/rev.txt -O rev.txt
- wget http://www.mayor.hu/download/current/md5sum -O mayor-orig/md5sum
+ 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
+ cd /tmp
- for i in $(cat "$pd"/mayor-orig/md5sum | tail -n+2 | cut -d ' ' -f 3); do
+ 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
+ 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/'
+ 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 add --all
+ git commit -a -m "Rev: $nrev"
+ git tag -a "rev$nrev" -m "Rev: $nrev"
+ fi
fi
git checkout master