1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

handle ctrl-c in upgrade scripts

This commit is contained in:
Sylvain 2019-10-22 16:46:40 +02:00
parent b4ee2f9b85
commit c0acfe0f1c
2 changed files with 16 additions and 4 deletions

View File

@ -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'

View File

@ -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