tools/daemon/updateGameData.sh
changeset 2138 219a2d897900
child 2139 88a628af03f6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/daemon/updateGameData.sh	Tue Jul 01 09:13:27 2008 +0000
     1.3 @@ -0,0 +1,30 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +FILENAME=""
     1.7 +SUMSFILE=""
     1.8 +
     1.9 +if [ -n "$1" ]
    1.10 +then
    1.11 +	FILENAME="$1.txt"
    1.12 +	SUMSFILE="$1.sums"
    1.13 +else
    1.14 +	echo "Need to specify a gamedata filename"
    1.15 +	exit -1
    1.16 +fi
    1.17 +
    1.18 +
    1.19 +if [ -s $FILENAME ]
    1.20 +then
    1.21 +	#run ./gamedatamd5 on this file and pipe output+filename into $1.sums
    1.22 +	MD5=`./gamedatamd5 $FILENAME`
    1.23 +	#need to stop here if gamedatamd5 failed. (returns -1 and prints to stderr)
    1.24 +	echo "$MD5" > "$SUMSFILE"
    1.25 +	echo "$FILENAME" >> "$SUMSFILE"
    1.26 +	ln -s "$SUMSFILE" "$MD5"
    1.27 +
    1.28 +	exit 0
    1.29 +fi
    1.30 +
    1.31 +echo "File $FILENAME not found!"
    1.32 +
    1.33 +exit -1
    1.34 \ No newline at end of file