diff --git a/scripts/elastic-upgrade.sh b/scripts/elastic-upgrade.sh index 9d856c6c2..9a06fc4e4 100755 --- a/scripts/elastic-upgrade.sh +++ b/scripts/elastic-upgrade.sh @@ -629,13 +629,19 @@ start_upgrade() esac } +function trap_ctrlc() +{ + echo "Ctrl^C, exiting..." + exit 2 +} + upgrade_elastic() { config detect_installation read -rp "Continue with upgrading? (y/n) " confirm </dev/tty - if [[ "$confirm" = "y" ]] - then + if [[ "$confirm" = "y" ]]; then + trap "trap_ctrlc" 2 # SIGINT ensure_initial_status_green start_upgrade '1.7' '2.4' reindex_indices '24' diff --git a/scripts/postgre-upgrade.sh b/scripts/postgre-upgrade.sh index 52a652104..59c18a564 100755 --- a/scripts/postgre-upgrade.sh +++ b/scripts/postgre-upgrade.sh @@ -166,12 +166,18 @@ clean() fi } +function trap_ctrlc() +{ + echo "Ctrl^C, exiting..." + exit 2 +} + upgrade_postgres() { config read -rp "Continue with upgrading? (y/N) " confirm </dev/tty - if [[ "$confirm" = "y" ]] - then + if [[ "$confirm" = "y" ]]; then + trap "trap_ctrlc" 2 # SIGINT OLD='9.4' NEW='9.6' read_path