dumploadtest.sh: added an exit 0 to the top of the script.
[citadel.git] / citadel / dumploadtest.sh
1 #!/bin/bash
2
3
4 # This script dumps the database, deletes the database, loads the database, dumps it again...
5 # ...and then compares the two dumps to see if we have full fidelity between them.
6 #
7 # Did you read that correctly?  Yes, it will DELETE your database.  So don't run this.
8
9 exit 0          # In fact, here's an exit statement you must delete before you can even run it.
10
11 ps ax | grep citserver | grep -v grep >/dev/null 2>/dev/null && {
12         echo dont do this while the server is running
13         exit 1
14 }
15
16 ./ctdldump -y >dump.dat
17 first=$(md5sum dump.dat | awk ' { print $1 } ' )
18 rm -fv data/*
19 ./ctdlload -y <dump.dat
20 ./ctdldump -y >dump.dat
21 second=$(md5sum dump.dat | awk ' { print $1 } ' )
22
23 echo
24 echo
25 echo MD5 of initial dump: ${first}
26 echo MD5 of sequent dump: ${second}
27 echo
28 if [ ${first} == ${second} ] ; then
29         echo Congratulations, you have full fidelity between two dumps.
30 else
31         echo Epic fail, you do NOT have full fidelity between two dumps.
32 fi