diff options
author | gumi <git@gumi.ca> | 2018-01-16 11:45:39 -0500 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-01-16 11:45:39 -0500 |
commit | bf38d6cf388b687758f11c998f8eeab25fd21b25 (patch) | |
tree | 708243c2a3ecb28a2007db4a714fc6b9db0fe5a1 /client/make-updates | |
parent | b90911151c327adc3674914350ae5358cb0184bb (diff) | |
download | tools-bf38d6cf388b687758f11c998f8eeab25fd21b25.tar.gz tools-bf38d6cf388b687758f11c998f8eeab25fd21b25.tar.bz2 tools-bf38d6cf388b687758f11c998f8eeab25fd21b25.tar.xz tools-bf38d6cf388b687758f11c998f8eeab25fd21b25.zip |
add update checker to make-updates
Diffstat (limited to 'client/make-updates')
-rwxr-xr-x | client/make-updates | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/client/make-updates b/client/make-updates index 0f6ea67..0cab82f 100755 --- a/client/make-updates +++ b/client/make-updates @@ -1,16 +1,36 @@ #!/usr/bin/env bash # Copyright (C) 2011-2012 Evol Online -# Author: Andrei Karas (4144) +# Author: Andrei Karas (4144), gumi dir=`pwd` output=~/www/updates cdata=../../client-data +http_root="http://updates.themanaworld.org/updates" LDLIBS=-lz prefix=/usr/local CC=${CC:=gcc} +function check_update() { + test_command=` \ + curl -sL \ + -w "%{http_code}\n" \ + "$1" \ + -o /dev/null \ + --connect-timeout 3 \ + --max-time 5` + + if [ ${test_command} == "200" ] ; + then + echo -e "hit $1 (\e[92m$test_command OK\e[0m)"; + else + echo -e "\e[31m!!FAILED!!\e[0m $1 ($test_command)"; + exit 1; + fi +} + + echo "======= Legacy =======" echo ">> Building adler32..." @@ -62,6 +82,12 @@ chmod a+r Legacy.zip chmod a+r resources2.txt chmod a+r resources.xml +echo ">> Checking updates..." +check_update "$http_root/Legacy.zip" +check_update "$http_root/resources.xml" +check_update "$http_root/resources2.txt" +check_update "$http_root/news.php" + popd # $dir/files popd # $cdata popd # tools/client |