summaryrefslogtreecommitdiff
path: root/client/make-music.sh
diff options
context:
space:
mode:
Diffstat (limited to 'client/make-music.sh')
-rw-r--r--client/make-music.sh37
1 files changed, 33 insertions, 4 deletions
diff --git a/client/make-music.sh b/client/make-music.sh
index cca2441..5b914cf 100644
--- a/client/make-music.sh
+++ b/client/make-music.sh
@@ -6,11 +6,31 @@
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-music ======="
echo ">> Building adler32..."
@@ -46,9 +66,18 @@ cp xml_header.txt resources.xml
cat xml_footer.txt >>resources.xml
echo ">> Moving stuff around..."
+cp -v Legacy-music.zip $output/
+cp -v resources.xml $output/
+
+echo ">> Giving read permissions..."
+pushd $output
chmod a+r Legacy-music.zip
-cp Legacy-music.zip $output/
chmod a+r resources.xml
-cp resources.xml $output/
-popd
-popd
+
+echo ">> Checking updates..."
+check_update "$http_root/Legacy-music.zip"
+check_update "$http_root/resources.xml"
+
+popd # $dir/files
+popd # $cdata
+popd # tools/client