3 # Script to sync the "checkupdate.txt" file on the web host with the version currently in git.
4 # Run this as root from the /var/www/update.xonotic.org directory.
8 export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
9 cd /var/www/update.xonotic.org
12 wget -qO checkupdate.txt "https://gitlab.com/xonotic/xonotic/-/raw/master/misc/infrastructure/checkupdate.txt"
14 grep "^V " checkupdate.txt | head -n 1 | cut -c 3-
15 grep "^D " checkupdate.txt | head -n 1 | cut -c 3-
16 grep "^U " checkupdate.txt | head -n 1 | cut -c 3-
17 } > checkupdate.txt.oldformat 2>/dev/null
18 grep '^[^#]' checkupdate.txt > checkupdate.txt.newformat
20 if [ x"`wc -l < checkupdate.txt.oldformat`" = x"3" ]; then
21 mv checkupdate.txt.newformat HTML/checkupdate.txt
22 mv checkupdate.txt.oldformat ../xonotic.org/HTML/dl/checkupdate.txt
24 echo "checkupdate.txt updating failed. Please debug."