mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-18 08:12:53 +01:00
add set_target_single function to only allow single jail targetting
This commit is contained in:
@@ -73,12 +73,9 @@ warn() {
|
|||||||
echo -e "${COLOR_YELLOW}$*${COLOR_RESET}"
|
echo -e "${COLOR_YELLOW}$*${COLOR_RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# This is where I am placing all new functions.
|
|
||||||
check_target_exists() {
|
check_target_exists() {
|
||||||
TARGET="${1}"
|
local TARGET="${1}"
|
||||||
JAILS=""
|
|
||||||
if [ -d "${bastille_jailsdir}"/"${TARGET}" ]; then
|
if [ -d "${bastille_jailsdir}"/"${TARGET}" ]; then
|
||||||
JAILS="${TARGET}"
|
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
error_exit "Jail not found."
|
error_exit "Jail not found."
|
||||||
@@ -95,6 +92,14 @@ check_target_is_running() {
|
|||||||
set_target() {
|
set_target() {
|
||||||
if [ "${1}" = ALL ] || [ "${1}" = all ]; then
|
if [ "${1}" = ALL ] || [ "${1}" = all ]; then
|
||||||
target_all_jails
|
target_all_jails
|
||||||
|
else
|
||||||
|
TARGET="${1}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_target_single() {
|
||||||
|
if [ "${1}" = ALL ] || [ "${1}" = all ]; then
|
||||||
|
error_exit "[all|ALL] not supported with this command."
|
||||||
else
|
else
|
||||||
TARGET="${1}"
|
TARGET="${1}"
|
||||||
check_target_exists "${TARGET}"
|
check_target_exists "${TARGET}"
|
||||||
|
|||||||
Reference in New Issue
Block a user