From af5962b3c120a2d86e6a59ce3559d4e802eb1f07 Mon Sep 17 00:00:00 2001 From: "It's me, CI" Date: Tue, 24 Oct 2023 12:34:40 -0700 Subject: [PATCH] Allow passing hashes_file and update_script names on command line --- scripts/migrate-receipt-chain-hashes.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/migrate-receipt-chain-hashes.sh b/scripts/migrate-receipt-chain-hashes.sh index 63c7d904f3d..13192a3b546 100755 --- a/scripts/migrate-receipt-chain-hashes.sh +++ b/scripts/migrate-receipt-chain-hashes.sh @@ -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