]> code.citadel.org Git - citadel.git/blobdiff - citadel/dumploadtest.sh
Fix ansi auto-detect
[citadel.git] / citadel / dumploadtest.sh
index 4af546ff66a9c0db6e4a5f0aa746d147fbee7529..835986ec79463d7cc3e2af079a5837991d8bfb18 100755 (executable)
@@ -1,12 +1,31 @@
 #!/bin/bash
 
+# This script dumps the database, deletes the database, loads the database, dumps it again...
+# ...and then compares the two dumps to see if we have full fidelity between them.
+#
+# Did you read that correctly?  Yes, it will DELETE your database.  So don't run this.
+
+
+if [ "${YES_DELETE_MY_DATABASE}" != '' ] ; then
+       echo Ah, I see you have set YES_DELETE_MY_DATABASE to a non-empty value.
+       echo The dump and load test will now proceed.
+else
+       echo 'This script dumps the database, deletes the database, loads the database, dumps it again...'
+       echo '...and then compares the two dumps to see if we have full fidelity between them.'
+       echo 'Did you read that correctly?  Yes, it will DELETE your database.'
+       echo 'If this is really what you want, set the environment variable YES_DELETE_MY_DATABASE'
+       echo 'to a non-empty value, and run it again.'
+       exit 0
+fi
+
 ps ax | grep citserver | grep -v grep >/dev/null 2>/dev/null && {
-       echo dont do this while the server is running
+       echo Do not do this while the server is running.
        exit 1
 }
 
 ./ctdldump -y >dump.dat
 first=$(md5sum dump.dat | awk ' { print $1 } ' )
+
 rm -fv data/*
 ./ctdlload -y <dump.dat
 ./ctdldump -y >dump.dat