]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2293] minor kea-admin adjustments
authorAndrei Pavel <andrei@isc.org>
Mon, 23 May 2022 13:19:49 +0000 (16:19 +0300)
committerAndrei Pavel <andrei@isc.org>
Mon, 23 May 2022 14:21:38 +0000 (17:21 +0300)
ChangeLog
src/bin/admin/kea-admin.in

index ba491b8a0a69da13f24a5e79c8073525f85b2e9c..0a266dee191af92f952a4a127c60c6c207802d74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,9 +2,10 @@
        kea-admin lease-upload will now call the lease file cleanup (LFC)
        process to clean up entries with duplicate addresses in the input
        CSV file to avoid a conflict error when inserting the leases in
-       the database. kea-admin has also gained a new -y|--yes flag that
-       enables automatic overwriting of any file that it writes to, when
-       dumping or uploading leases.
+       the database. kea-admin also doesn't ask for input on
+       non-interactive shells anymore and it gained a new -y|--yes flag
+       that enables automatic overwriting of any file that it writes to,
+       when dumping or uploading leases.
        (Gitlab #2293)
 
 2021.  [build]         razvan
index f2719abc46137f3f6a02ef0cd05f16a0303533a3..7e4388b2abb4173eaf51684610468c98d5909757 100644 (file)
@@ -411,12 +411,10 @@ pgsql_upgrade() {
 # Remove a file if it exists
 remove_file () {
     local file="${1}"
-    if [ ! -z "${file}" ] && [ -e "${file}" ]
+    if [ -e "${file}" ]
     then
-        echo "Removing file ${file}"
+        log_info "Removing file ${file}..."
         rm -f "${file}"
-    else
-        echo "File ${file} does not exist, no need to remove it."
     fi
 }
 
@@ -435,7 +433,7 @@ check_file_overwrite () {
 
         # Ask for an answer only on an interactive shell to prevent blocking in
         # automated or non-interactive scenarios where the answer defaults to no.
-        if [[ $- == *i* ]]; then
+        if test -t 0; then
             read -r ans
         else
             log_warning 'Non-interactive tty detected. Assuming no.'