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
# 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
}
# 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.'