X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Finfrastructure%2Frefresh-checkupdate.sh;fp=misc%2Finfrastructure%2Frefresh-checkupdate.sh;h=a08edd4ea141c6350577b8874605b56e2bc59dbf;hp=0000000000000000000000000000000000000000;hb=7dcb54c199acf6b7fd460fc5f962d1d269a0854e;hpb=3d56c28c850dfe456298965b8f50cba8bfc468a5 diff --git a/misc/infrastructure/refresh-checkupdate.sh b/misc/infrastructure/refresh-checkupdate.sh new file mode 100755 index 00000000..a08edd4e --- /dev/null +++ b/misc/infrastructure/refresh-checkupdate.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Script to sync the "checkupdate.txt" file on the web host with the version currently in git. +# Run this as root from the /var/www/update.xonotic.org directory. + +set -e + +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" +cd /var/www/update.xonotic.org + +rm -f checkupdate.txt +wget -qO checkupdate.txt "http://git.xonotic.org/?p=xonotic/xonotic.git;a=blob_plain;f=misc/infrastructure/checkupdate.txt" +{ + grep "^V " checkupdate.txt | head -n 1 | cut -c 3- + grep "^D " checkupdate.txt | head -n 1 | cut -c 3- + grep "^U " checkupdate.txt | head -n 1 | cut -c 3- +} > checkupdate.txt.oldformat 2>/dev/null +grep '^[^#]' checkupdate.txt > checkupdate.txt.newformat +rm -f checkupdate.txt +if [ x"`wc -l < checkupdate.txt.oldformat`" = x"3" ]; then + mv checkupdate.txt.newformat HTML/checkupdate.txt + mv checkupdate.txt.oldformat ../xonotic.org/HTML/dl/checkupdate.txt +else + echo "checkupdate.txt updating failed. Please debug." +fi +