tools/daemon/updateGameData.sh
changeset 2139 88a628af03f6
parent 2138 219a2d897900
     1.1 --- a/tools/daemon/updateGameData.sh	Tue Jul 01 09:13:27 2008 +0000
     1.2 +++ b/tools/daemon/updateGameData.sh	Tue Jul 01 09:24:22 2008 +0000
     1.3 @@ -1,30 +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
    1.35 +#!/bin/bash
    1.36 +
    1.37 +FILENAME=""
    1.38 +SUMSFILE=""
    1.39 +
    1.40 +if [ -n "$1" ]
    1.41 +then
    1.42 +	FILENAME="$1.txt"
    1.43 +	SUMSFILE="$1.sums"
    1.44 +else
    1.45 +	echo "Need to specify a gamedata filename"
    1.46 +	exit -1
    1.47 +fi
    1.48 +
    1.49 +
    1.50 +if [ -s $FILENAME ]
    1.51 +then
    1.52 +	#run ./gamedatamd5 on this file and pipe output+filename into $1.sums
    1.53 +	MD5=`./gamedatamd5 $FILENAME`
    1.54 +	#need to stop here if gamedatamd5 failed. (returns -1 and prints to stderr)
    1.55 +	echo "$MD5" > "$SUMSFILE"
    1.56 +	echo "$FILENAME" >> "$SUMSFILE"
    1.57 +	ln -s "$SUMSFILE" "$MD5"
    1.58 +
    1.59 +	exit 0
    1.60 +fi
    1.61 +
    1.62 +echo "File $FILENAME not found!"
    1.63 +
    1.64 +exit -1