]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/infrastructure/refresh-checkupdate.sh
Fix macOS SDL2 framework permissions
[xonotic/xonotic.git] / misc / infrastructure / refresh-checkupdate.sh
1 #!/bin/sh
2
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.
5
6 set -e
7
8 export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
9 cd /var/www/update.xonotic.org
10
11 rm -f checkupdate.txt
12 wget -qO checkupdate.txt "https://gitlab.com/xonotic/xonotic/-/raw/master/misc/infrastructure/checkupdate.txt"
13 {
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
19 rm -f checkupdate.txt
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
23 else
24         echo "checkupdate.txt updating failed. Please debug."
25 fi
26