set_target and error_continue functions

This commit is contained in:
tschettervictor
2024-12-23 18:23:31 -07:00
committed by GitHub
parent d2dc83d320
commit 341db36103

View File

@@ -56,6 +56,11 @@ error_notify() {
echo -e "${COLOR_RED}$*${COLOR_RESET}" 1>&2
}
error_continue() {
error_notify "$@"
continue
}
# Notify message on error and exit
error_exit() {
error_notify "$@"
@@ -118,6 +123,19 @@ EOF
fi
}
set_target() {
local _TARGET="${1}"
if [ "${_TARGET}" = ALL ] || [ "${_TARGET}" = all ]; then
target_all_jails
else
check_target_exists "${_TARGET}" || exit
JAILS="${_TARGET}"
TARGET="${_TARGET}"
export JAILS
export TARGET
fi
}
checkyesno() {
## copied from /etc/rc.subr -- cedwards (20231125)
## issue #368 (lowercase values should be parsed)