Skip to content

Commit

Permalink
update_bareos_tables: show update warning only once
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens committed Oct 16, 2017
1 parent 914a57d commit 8353cec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cats/update_bareos_tables.in
Expand Up @@ -36,6 +36,8 @@ temp_sql_schema="/tmp/tables.sql.$$"
default_db_type=`get_database_driver_default`
working_dir=`get_working_dir`

SHOW_WARNING="yes"

if [ "$1" = "-f" ]; then
FORCE="yes"
shift || true
Expand Down Expand Up @@ -139,13 +141,15 @@ do
exit 1
fi

if [ ${DBVERSION} -lt 2170 ]; then
if [ "${SHOW_WARNING}" = "yes" -a ${DBVERSION} -lt 2171 ]; then
echo "WARNING:"
echo " Updating the database to schema version 2170 will increase the required disk space."
echo " Updating the database to schema version 2171 will increase the required disk space."
echo " Especially it will require around twice the amount of disk space, during the migration."
if [ "$FORCE" != "yes" ]; then
echo " Please verfiy you got enough disk space available and confirm by pressing <ENTER>."
read input
# warning already shown and confirmed. No need to show it again.
SHOW_WARNING="no"
fi
fi

Expand Down

0 comments on commit 8353cec

Please sign in to comment.