turtle-wow-source-kinda/Dumps/Source Code/20 - Development_turtle-logs/main/Database/merger.sh
Brian Oost a1d5bb70b2 Init
2024-08-06 18:06:40 +02:00

23 lines
474 B
Bash

if [ ! -f "./db_patch_count" ]; then
echo "-1" > ./db_patch_count
fi
COUNT=$(cat ./db_patch_count)
COUNT=$(expr ${COUNT} + 0)
if [ -f "./merge.sql" ]; then
rm ./merge.sql
fi
for filename in ./patches/*.gz; do
if [ ! -f "${filename}" ]; then
continue
fi
FILE=${filename:10}
VERSION=$(expr ${FILE:0:5} + 0)
if (( ${VERSION} > ${COUNT} )); then
gzip -dc ${filename} >> merge.sql
echo "" >> merge.sql
echo ${VERSION} > ./db_patch_count
fi
done