From 7dcb54c199acf6b7fd460fc5f962d1d269a0854e Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 13 Dec 2020 09:27:22 -0500 Subject: [PATCH] Add script to sync checkupdate.txt on the web host. --- misc/infrastructure/refresh-checkupdate.sh | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 misc/infrastructure/refresh-checkupdate.sh 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 + -- 2.39.2