Skip to content

Commit

Permalink
Allow passing hashes_file and update_script names on command line
Browse files Browse the repository at this point in the history
  • Loading branch information
It's me, CI committed Oct 24, 2023
1 parent 74be2a6 commit af5962b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/migrate-receipt-chain-hashes.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/bash

if [ ! $# -eq 1 ] ; then
echo "Usage" $0 archive-db
if [ $# -lt 1 ] || [ $# -gt 3 ]; then
echo "Usage" $0 archive-db [hashes_file] [update_script]
echo "'hashes_file' and 'update_script' are created when running this script"
exit 0
fi

ARCHIVE_DB=$1
HASHES_FILE=hashes_file.tmp
UPDATE_SCRIPT=hashes_update.sql
HASHES_FILE=${2:-hashes_file.tmp}
UPDATE_SCRIPT=${3:-hashes_update.sql}

echo "Migrating receipt chain hashes in account preconditions in archive db '"$ARCHIVE_DB"'"
echo "Using temporary file '"$HASHES_FILE"' and creating SQL script '"$UPDATE_SCRIPT"'"

rm -f $HASHES_FILE
rm -f $UPDATE_SCRIPT
Expand Down

0 comments on commit af5962b

Please sign in to comment.