From 780438599de627bfdc9406b7dd469767b35123f5 Mon Sep 17 00:00:00 2001 From: Henning Westerholt Date: Mon, 18 Feb 2019 20:58:41 +0100 Subject: [PATCH] kamdbctl: warn that drop cmd will drop existing DB, ask for confirmation (GH #1858) - warn that the drop command will drop existing DB, ask for confirmation - manually merge pull request GH #1858 from fredposner, fred at qxork dot com --- utils/kamctl/kamdbctl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl index e66f3eb4cef..ea15329a199 100755 --- a/utils/kamctl/kamdbctl +++ b/utils/kamctl/kamdbctl @@ -398,6 +398,14 @@ case $1 in drop) # delete kamailio database # create new database structures + + # confirm dropping of database + echo -e "This will drop your current database.\nIt is recommended to first backup your database.\n" + get_answer ask "Continue with drop? (y/n): " + if [ "$ANSWER" != "y" ]; then + exit 1 + fi + shift if [ $# -eq 1 ] ; then DBNAME="$1"