diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a71fa8..d5ade18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +* bkctld-rename: abort operation if incs exist with the new name + ### Deprecated ### Removed diff --git a/lib/bkctld-rename b/lib/bkctld-rename index 2147a13..3270ea9 100755 --- a/lib/bkctld-rename +++ b/lib/bkctld-rename @@ -14,6 +14,7 @@ new_jail_name="${2:?}" if [ -z "${jail_name}" ] || [ -z "${new_jail_name}" ]; then show_help && exit 1 fi + jail_path=$(jail_path "${jail_name}") incs_path=$(incs_path "${jail_name}") jail_config_dir=$(jail_config_dir "${jail_name}") @@ -27,6 +28,7 @@ new_jail_config_dir=$(jail_config_dir "${new_jail_name}") new_legacy_config_file="${CONFDIR}/${new_jail_name}" test -d "${new_jail_path}" && error "${new_jail_name}: jail already exists" 2 +test -d "${new_incs_path}" && error "${new_jail_name}: incs already exists" 2 "${LIBDIR}/bkctld-is-on" "${jail_name}" 2>/dev/null case "$?" in