From eba3acbc42efdde1759059aa77e9164aef6a4b32 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 20 Dec 2020 09:02:59 -0500 Subject: [PATCH] Check if tos text has more than one line. Use a suffix. --- misc/infrastructure/refresh-tos.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/misc/infrastructure/refresh-tos.sh b/misc/infrastructure/refresh-tos.sh index 32ec10c2..8e3d7677 100755 --- a/misc/infrastructure/refresh-tos.sh +++ b/misc/infrastructure/refresh-tos.sh @@ -8,5 +8,12 @@ set -e export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" cd /var/www/update.xonotic.org/HTML -rm -f tos.txt -wget -qO tos.txt "https://gitlab.com/xonotic/xonotic/-/raw/master/misc/infrastructure/tos.txt" +wget -qO tos.txt.new "https://gitlab.com/xonotic/xonotic/-/raw/master/misc/infrastructure/tos.txt" + +if [ `wc -l tos.txt.new | awk '{print $1}'` -ge "2" ]; then + echo "tos.txt update succeeded." + mv tos.txt.new tos.txt +else + echo "tos.txt updating failed. Please debug." +fi + -- 2.39.2