diff options
Diffstat (limited to 'checkupdate.sh')
-rwxr-xr-x | checkupdate.sh | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/checkupdate.sh b/checkupdate.sh index 5e20e8bd..d6ab116e 100755 --- a/checkupdate.sh +++ b/checkupdate.sh @@ -2,34 +2,37 @@ orev=$(cat rev.txt) -nrev=$(wget http://www.mayor.hu/download/rev.txt -O -) +nrev=$(wget http://www.mayor.hu/download/current/md5sum -O - | grep 'Revision' | cut -d ' ' -f 2) pd=$(pwd) if [ "$nrev" -gt "$orev" ]; then - wget http://www.mayor.hu/download/rev.txt -O rev.txt + 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/ - wget http://www.mayor.hu/download/current/mayor-base-current.tgz - wget http://www.mayor.hu/download/current/mayor-naplo-current.tgz - wget http://www.mayor.hu/download/current/mayor-portal-current.tgz - - wget http://www.mayor.hu/download/current/mayor-installer-current.tgz - - cd $pd/mayor-installer-orig/ - tar -xzf /tmp/mayor-installer-current.tgz + 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/mayor-orig/ - tar -xzf /tmp/mayor-base-current.tgz - tar -xzf /tmp/mayor-naplo-current.tgz - tar -xzf /tmp/mayor-portal-current.tgz - 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" - + fi |