bkctld-rename: abort operation if incs exist with the new name
This commit is contained in:
parent
09f1789a53
commit
a2c6d073a7
|
@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
* bkctld-rename: abort operation if incs exist with the new name
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
|
@ -14,6 +14,7 @@ new_jail_name="${2:?}"
|
||||||
if [ -z "${jail_name}" ] || [ -z "${new_jail_name}" ]; then
|
if [ -z "${jail_name}" ] || [ -z "${new_jail_name}" ]; then
|
||||||
show_help && exit 1
|
show_help && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jail_path=$(jail_path "${jail_name}")
|
jail_path=$(jail_path "${jail_name}")
|
||||||
incs_path=$(incs_path "${jail_name}")
|
incs_path=$(incs_path "${jail_name}")
|
||||||
jail_config_dir=$(jail_config_dir "${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}"
|
new_legacy_config_file="${CONFDIR}/${new_jail_name}"
|
||||||
|
|
||||||
test -d "${new_jail_path}" && error "${new_jail_name}: jail already exists" 2
|
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
|
"${LIBDIR}/bkctld-is-on" "${jail_name}" 2>/dev/null
|
||||||
case "$?" in
|
case "$?" in
|
||||||
|
|
Loading…
Reference in a new issue