Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UPDATE] New Rewrite [UPDATE] - please test and report bugs #777

Closed
wants to merge 130 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
000635e
Update bootstrap.sh
tschettervictor Dec 19, 2024
2d4fc36
Update clone.sh
tschettervictor Dec 19, 2024
84eb497
Update clone.sh
tschettervictor Dec 19, 2024
2e67d85
Update clone.sh
tschettervictor Dec 19, 2024
10b84bb
Update clone.sh
tschettervictor Dec 19, 2024
608d046
Update clone.sh
tschettervictor Dec 19, 2024
5cbd3b4
Update cmd.sh
tschettervictor Dec 19, 2024
8dd5128
Update common.sh
tschettervictor Dec 19, 2024
86f6575
Update config.sh
tschettervictor Dec 19, 2024
77cb14a
Update console.sh
tschettervictor Dec 19, 2024
ff00e70
Update convert.sh
tschettervictor Dec 19, 2024
35d138d
Update cp.sh
tschettervictor Dec 19, 2024
0d4b8be
Update create.sh
tschettervictor Dec 19, 2024
70e8ec2
Update destroy.sh
tschettervictor Dec 19, 2024
4b735c0
Update edit.sh
tschettervictor Dec 19, 2024
572f3d0
Create etcupdate.sh
tschettervictor Dec 19, 2024
bf8aaf7
Update export.sh
tschettervictor Dec 19, 2024
5bc2c44
Update htop.sh
tschettervictor Dec 19, 2024
1e2936d
Update import.sh
tschettervictor Dec 19, 2024
736e070
Update limits.sh
tschettervictor Dec 19, 2024
f992c18
Update list.sh
tschettervictor Dec 19, 2024
897bd26
Update mount.sh
tschettervictor Dec 19, 2024
a66f525
Update pkg.sh
tschettervictor Dec 19, 2024
a40e861
Update rcp.sh
tschettervictor Dec 19, 2024
58ca2af
Update rdr.sh
tschettervictor Dec 19, 2024
b0b2d93
Update rename.sh
tschettervictor Dec 19, 2024
ca5febd
Update service.sh
tschettervictor Dec 19, 2024
bd5d603
Update start.sh
tschettervictor Dec 19, 2024
1aa8e80
Update stop.sh
tschettervictor Dec 19, 2024
818beed
Update sysrc.sh
tschettervictor Dec 19, 2024
86561fe
Update tags.sh
tschettervictor Dec 19, 2024
948af9b
Update template.sh
tschettervictor Dec 19, 2024
7a5223d
Update top.sh
tschettervictor Dec 19, 2024
37cf018
Update umount.sh
tschettervictor Dec 19, 2024
9030382
Update upgrade.sh
tschettervictor Dec 19, 2024
8a57cb5
Update update.sh
tschettervictor Dec 19, 2024
2df124a
Update verify.sh
tschettervictor Dec 19, 2024
7349638
Update zfs.sh
tschettervictor Dec 19, 2024
6ead268
final
tschettervictor Dec 21, 2024
e5fd655
Update Bastillefile
tschettervictor Dec 21, 2024
9073f75
final
tschettervictor Dec 21, 2024
8c1e6ae
final
tschettervictor Dec 21, 2024
33c577c
final
tschettervictor Dec 21, 2024
d2ac0d0
final
tschettervictor Dec 21, 2024
f5c7b43
final
tschettervictor Dec 21, 2024
0f708cc
final
tschettervictor Dec 21, 2024
844674f
Update convert.sh
tschettervictor Dec 21, 2024
b89c969
final
tschettervictor Dec 21, 2024
9a91b14
final
tschettervictor Dec 21, 2024
a06fbf6
final
tschettervictor Dec 21, 2024
6e6cc31
final
tschettervictor Dec 21, 2024
deb2f55
final
tschettervictor Dec 21, 2024
d3f82bc
final
tschettervictor Dec 21, 2024
715db61
final
tschettervictor Dec 21, 2024
d563d88
final
tschettervictor Dec 21, 2024
c34a299
final
tschettervictor Dec 21, 2024
6958f37
final
tschettervictor Dec 21, 2024
d18eae5
final
tschettervictor Dec 21, 2024
50f86ea
final
tschettervictor Dec 21, 2024
7d02dd9
final
tschettervictor Dec 21, 2024
acae673
final
tschettervictor Dec 21, 2024
807b11c
final
tschettervictor Dec 21, 2024
42450cb
final
tschettervictor Dec 21, 2024
6ea187a
final
tschettervictor Dec 21, 2024
50b8a2c
final
tschettervictor Dec 21, 2024
fc85e1e
final
tschettervictor Dec 21, 2024
ce1e338
final
tschettervictor Dec 21, 2024
0727798
final
tschettervictor Dec 21, 2024
fb09f0f
final
tschettervictor Dec 21, 2024
1c5930c
final
tschettervictor Dec 21, 2024
ec5fdb4
final
tschettervictor Dec 21, 2024
4640cae
first go at shellcheck correction
tschettervictor Dec 21, 2024
fccf4b5
next attempt at shellcheck
tschettervictor Dec 21, 2024
3b38f8f
next try
tschettervictor Dec 21, 2024
99830d2
next
tschettervictor Dec 21, 2024
c7f744f
next
tschettervictor Dec 21, 2024
8b4871c
copyright year
tschettervictor Dec 21, 2024
5cb6999
rename fixes
tschettervictor Dec 21, 2024
7c0acb1
integrate latest PRs
tschettervictor Dec 22, 2024
53f64f6
Allow file mounting
tschettervictor Dec 22, 2024
4d05174
Update mount.sh
tschettervictor Dec 22, 2024
72cceba
Strip // to /
tschettervictor Dec 22, 2024
f623d25
Strip // to /
tschettervictor Dec 22, 2024
138414d
Update umount.sh
tschettervictor Dec 22, 2024
16c9ac9
fix mounting and unmounting
tschettervictor Dec 23, 2024
7a82e71
Merge branch 'new_rewrite' of https://github.com/tschettervictor/bast…
tschettervictor Dec 23, 2024
fff6a03
Spacing
tschettervictor Dec 23, 2024
b3a042c
Spacing
tschettervictor Dec 23, 2024
d2d176d
More spacing
tschettervictor Dec 23, 2024
4ec894f
imporve mounting and add error_continue function
tschettervictor Dec 23, 2024
c5a3ad5
Merge branch 'new_rewrite' of https://github.com/tschettervictor/bast…
tschettervictor Dec 23, 2024
17f52a1
fix brace
tschettervictor Dec 23, 2024
484be5a
disable shellcheck 2104 as this is a special function
tschettervictor Dec 23, 2024
d5f03c6
spacing
tschettervictor Dec 23, 2024
bcf1634
mount and umount bug fixes
tschettervictor Dec 24, 2024
8732309
spacing fix
tschettervictor Dec 24, 2024
8be23ea
more fixes and improvements
tschettervictor Dec 24, 2024
6f055fe
more improvements and code cleanup
tschettervictor Dec 24, 2024
697c81d
more code cleanup
tschettervictor Dec 24, 2024
891a847
fix case
tschettervictor Dec 24, 2024
a953fb7
close to final arrangement of code
tschettervictor Dec 24, 2024
3fdd00a
fixes
tschettervictor Dec 24, 2024
96466c2
Remove warn about existing rdr rule
tschettervictor Dec 25, 2024
029c656
Optional stop on clone with zfs
tschettervictor Dec 25, 2024
d8b0a8d
Add restart to clone
tschettervictor Dec 25, 2024
b4060fe
more fixes and improvements
tschettervictor Dec 27, 2024
9c676f6
fix mount
tschettervictor Dec 27, 2024
8f57115
Merge branch 'master' into new_rewrite
tschettervictor Dec 27, 2024
f6a6439
update for multi interfaces
tschettervictor Dec 31, 2024
b5dcf5a
add autocomplete
tschettervictor Dec 31, 2024
2beeefe
fix ""
tschettervictor Dec 31, 2024
cf29557
fix ""
tschettervictor Dec 31, 2024
101d1b5
disable sc2010
tschettervictor Dec 31, 2024
54489a8
rewrite: update network and template
tschettervictor Jan 3, 2025
6f6412e
Merge branch 'master' into new_rewrite
tschettervictor Jan 3, 2025
140ac35
fix shellcheck
tschettervictor Jan 3, 2025
0e351f6
Merge branch 'new_rewrite' of https://github.com/tschettervictor/bast…
tschettervictor Jan 3, 2025
366d4e7
add classic jail multiple if
tschettervictor Jan 4, 2025
4db78eb
Merge branch 'BastilleBSD:master' into new_rewrite
tschettervictor Jan 4, 2025
6e3d207
update
tschettervictor Jan 4, 2025
82f94a6
Shellcheck 2034 disable
tschettervictor Jan 5, 2025
82be42f
Merge branch 'master' into new_rewrite
tschettervictor Jan 5, 2025
35ff2ec
new: add debug + code cleanup
tschettervictor Jan 10, 2025
00c51a4
Merge branch 'master' into new_rewrite
tschettervictor Jan 10, 2025
9381e19
new: fix shellcheck
tschettervictor Jan 10, 2025
5bc98c3
Merge branch 'new_rewrite' of https://github.com/tschettervictor/bast…
tschettervictor Jan 10, 2025
ffae769
new: fix more shellchek
tschettervictor Jan 10, 2025
0fc58fa
mount: allow options
tschettervictor Jan 10, 2025
cbae856
Merge branch 'master' into new_rewrite
tschettervictor Jan 13, 2025
83b3201
start/stop: update to allow new style interface
tschettervictor Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more fixes and improvements
tschettervictor committed Dec 27, 2024
commit b4060fe3f8655674af31dace303b115a1e94f95a
61 changes: 44 additions & 17 deletions usr/local/share/bastille/clone.sh
Original file line number Diff line number Diff line change
@@ -32,33 +32,48 @@
. /usr/local/etc/bastille/bastille.conf

usage() {
error_exit "Usage: bastille clone TARGET NEW_NAME IP_ADDRESS"

error_notify "Usage: bastille clone [option(s)] TARGET NEW_NAME IP_ADDRESS"
cat << EOF
Options:

-r | --restart -- Start/Restart jail(s) on completion.
-f | --force -- Stop the jail if it is running.
Mandatory for UFS, optional for ZFS.

-l | --live -- Clone a running jail. ZFS only.
Jail must be running.
Cannot be used with [-f|--force].
-f | --force -- Stop the jail if it is running.
Cannot be used with [-l|--live].
-s | --start -- Start jail(s) when complete.

EOF
exit 1
}

# Handle options.
LIVE=0
FORCE=0
RESTART=0
START=0
while [ "$#" -gt 0 ]; do
case "${1}" in
-h|--help|help)
usage
;;
-r|--restart)
RESTART=1
shift
-l|--live)
if ! checkyesno bastille_zfs_enable; then
error_exit "[-l|--live] can only be used with ZFS."
else
LIVE=1
shift
fi
;;
-f|--force)
FORCE=1
if [ "${LIVE}" -eq 1 ]; then
error_exit "[-f|--force] cannot be used with [-l|--live]."
else
FORCE=1
shift
fi
;;
-s|--start)
START=1
shift
;;
-*)
@@ -161,8 +176,8 @@ update_jailconf_vnet() {
sed -i '' "s|e\([0-9]\{1,\}\)b_${NEWNAME}|e${uniq_epair_bridge}b_${NEWNAME}|g" "${JAIL_CONFIG}"
sed -i '' "s|epair\([0-9]\{1,\}\)|epair${uniq_epair_bridge}|g" "${JAIL_CONFIG}"
sed -i '' "s|exec.prestart += \"ifconfig e0a_bastille\([0-9]\{1,\}\).*description.*|exec.prestart += \"ifconfig e0a_${uniq_epair} description \\\\\"vnet host interface for Bastille jail ${NEWNAME}\\\\\"\";|" "${JAIL_CONFIG}"
sed -i '' "s|ether.*:.*:.*:.*:.*:.*a|ether ${macaddr}a|" "${JAIL_CONFIG}"
sed -i '' "s|ether.*:.*:.*:.*:.*:.*b|ether ${macaddr}b|" "${JAIL_CONFIG}"
sed -i '' "s|ether.*:.*:.*:.*:.*:.*a |ether ${macaddr}a |" "${JAIL_CONFIG}"
sed -i '' "s|ether.*:.*:.*:.*:.*:.*b |ether ${macaddr}b |" "${JAIL_CONFIG}"
break
fi
fi
@@ -205,8 +220,13 @@ clone_jail() {

if ! [ -d "${bastille_jailsdir}/${NEWNAME}" ]; then
if checkyesno bastille_zfs_enable; then
check_target_is_stopped "${TARGET}" || if [ "${FORCE}" -eq 1 ]; then
bastille stop "${TARGET}"
if [ "${LIVE}" -eq 1 ]; then
check_target_is_running "${TARGET}" || error_exit "[-l|--live] can only be used with a running jail."
elif [ "${FORCE}" -eq 1 ]; then
check_target_is_stopped "${TARGET}" || bastille stop "${TARGET}"
else
error_notify "Jail is running."
error_exit "Use [-f|--force] to force stop the jail, or [-l|--live] (ZFS only) to clone a running jail."
fi
if [ -n "${bastille_zfs_zpool}" ]; then
# Replicate the existing container
@@ -226,10 +246,11 @@ clone_jail() {
# Perform container file copy (archive mode)
check_target_is_stopped "${TARGET}" || if [ "${FORCE}" -eq 1 ]; then
bastille stop "${TARGET}"
cp -a "${bastille_jailsdir}/${TARGET}" "${bastille_jailsdir}/${NEWNAME}"
else
exit
error_notify "Jail is running."
error_exit "Use [-f|--force] to force stop the jail."
fi
cp -a "${bastille_jailsdir}/${TARGET}" "${bastille_jailsdir}/${NEWNAME}"
fi
else
error_exit "${NEWNAME} already exists."
@@ -245,6 +266,12 @@ clone_jail() {
else
info "Cloned '${TARGET}' to '${NEWNAME}' successfully."
fi
if [ "${START}" -eq 1 ]; then
if [ "${LIVE}" -eq 0 ]; then
bastille start "${TARGET}"
fi
bastille start "${NEWNAME}"
fi
}

# Check if IP address is valid.
15 changes: 8 additions & 7 deletions usr/local/share/bastille/cmd.sh
Original file line number Diff line number Diff line change
@@ -32,8 +32,7 @@
. /usr/local/etc/bastille/bastille.conf

usage() {
error_exit "Usage: bastille cmd TARGET command"

error_notify "Usage: bastille cmd TARGET command"
cat << EOF
Options:

@@ -77,15 +76,17 @@ RETURN=0
set_target "${TARGET}"

for _jail in ${JAILS}; do
# If target is stopped or not found, continue...

info "[${_jail}]:"

check_target_is_running "${_jail}" || if [ "${FORCE}" -eq 1 ]; then
bastille start "${_jail}"
else
continue
else
error_notify "Jail is not running."
error_continue "Use [-f|--force] to force start the jail."
fi

COUNT=$(($COUNT+1))
info "[${_jail}]:"
if grep -qw "linsysfs" "${bastille_jailsdir}/${_jail}/fstab"; then
# Allow executing commands on Linux jails.
echo "$@"
@@ -94,7 +95,7 @@ for _jail in ${JAILS}; do
echo "$@"
jexec -l -U root "${_jail}" "$@"
fi
ERROR_CODE="$?"
ERROR_CODE=$?
if [ "${ERROR_CODE}" -ne 0 ]; then
warn "[${_jail}]: ${ERROR_CODE}"
fi
7 changes: 2 additions & 5 deletions usr/local/share/bastille/common.sh
Original file line number Diff line number Diff line change
@@ -82,7 +82,6 @@ warn() {
check_target_exists() {
local _TARGET="${1}"
if [ ! -d "${bastille_jailsdir}"/"${_TARGET}" ]; then
error_notify "Jail not found \"${_TARGET}\""
return 1
else
return 0
@@ -92,7 +91,6 @@ check_target_exists() {
check_target_is_running() {
local _TARGET="${1}"
if [ ! "$(/usr/sbin/jls name | awk "/^${_TARGET}$/")" ]; then
error_notify "[${_TARGET}]: Not started. See 'bastille start ${_TARGET}'."
return 1
else
return 0
@@ -102,7 +100,6 @@ check_target_is_running() {
check_target_is_stopped() {
local _TARGET="${1}"
if [ "$(/usr/sbin/jls name | awk "/^${_TARGET}$/")" ]; then
error_notify "${_TARGET} is running. See 'bastille stop ${_TARGET}'."
return 1
else
return 0
@@ -114,7 +111,7 @@ set_target() {
if [ "${_TARGET}" = ALL ] || [ "${_TARGET}" = all ]; then
target_all_jails
else
check_target_exists "${_TARGET}" || exit
check_target_exists "${_TARGET}" || error_exit "Jail not found \"${_TARGET}\""
JAILS="${_TARGET}"
TARGET="${_TARGET}"
export JAILS
@@ -127,7 +124,7 @@ set_target_single() {
if [ "${_TARGET}" = ALL ] || [ "${_TARGET}" = all ]; then
error_exit "[all|ALL] not supported with this command."
else
check_target_exists "${_TARGET}" || exit
check_target_exists "${_TARGET}" || error_exit "Jail not found \"${_TARGET}\""
JAILS="${_TARGET}"
TARGET="${_TARGET}"
export JAILS
8 changes: 4 additions & 4 deletions usr/local/share/bastille/console.sh
Original file line number Diff line number Diff line change
@@ -32,8 +32,7 @@
. /usr/local/etc/bastille/bastille.conf

usage() {
error_exit "Usage: bastille console TARGET [user]"

error_notify "Usage: bastille console [option(s)] TARGET [user]"
cat << EOF
Options:

@@ -75,8 +74,9 @@ bastille_root_check
set_target_single "${TARGET}"
check_target_is_running "${TARGET}" || if [ "${FORCE}" -eq 1 ]; then
bastille start "${TARGET}"
else
exit
else
error_notify "Jail is not running."
error_continue "Use [-f|--force] to force start the jail."
fi

validate_user() {
7 changes: 4 additions & 3 deletions usr/local/share/bastille/convert.sh
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
. /usr/local/etc/bastille/bastille.conf

usage() {
error_exit "Usage: bastille convert [option(s)] TARGET"
error_notify "Usage: bastille convert [option(s)] TARGET"

cat << EOF
Options:
@@ -73,8 +73,9 @@ bastille_root_check
set_target_single "${TARGET}"
check_target_is_stopped "${TARGET}" || if [ "${FORCE}" -eq 1 ]; then
bastille stop "${TARGET}"
else
exit
else
error_notify "Jail is running."
error_exit "Use [-f|--force] to force stop the jail."
fi

convert_symlinks() {
9 changes: 4 additions & 5 deletions usr/local/share/bastille/cp.sh
Original file line number Diff line number Diff line change
@@ -32,8 +32,7 @@
. /usr/local/etc/bastille/bastille.conf

usage() {
error_exit "Usage: bastille cp [option(s)] TARGET HOST_PATH JAIL_PATH"

error_notify "Usage: bastille cp [option(s)] TARGET HOST_PATH JAIL_PATH"
cat << EOF
Options:

@@ -77,7 +76,7 @@ set_target "${TARGET}"
for _jail in ${JAILS}; do
info "[${_jail}]:"
bastille_jail_path="${bastille_jailsdir}/${_jail}/root"
cp "${OPTION}" "${CPSOURCE}" "${bastille_jail_path}${CPDEST}"
RETURN="$?"
return "${RETURN}"
if ! cp "${OPTION}" "${CPSOURCE}" "${bastille_jail_path}${CPDEST}"; then
error_continue "CP failed: ${CPSOURCE} -> ${bastille_jail_path}${CPDEST}"
fi
done
6 changes: 6 additions & 0 deletions usr/local/share/bastille/create.sh
Original file line number Diff line number Diff line change
@@ -506,6 +506,12 @@ create_jail() {
fi
fi

# Exit if jail was not started, which means something is wrong.
if ! check_target_is_running "${NAME}"; then
bastille destroy "${NAME}"
error_exit "[${NAME}]: Failed to create jail..."
fi

if [ -n "${VNET_JAIL}" ]; then
if [ -n "${bastille_template_vnet}" ]; then
## rename interface to generic vnet0
8 changes: 4 additions & 4 deletions usr/local/share/bastille/destroy.sh
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@

usage() {
error_notify "Usage: bastille destroy [option(s)] [JAIL|RELEASE]"

cat << EOF
Options:

@@ -50,10 +49,11 @@ destroy_jail() {
bastille_jail_base="${bastille_jailsdir}/${TARGET}" ## dir
bastille_jail_log="${bastille_logsdir}/${TARGET}_console.log" ## file

check_target_is_stopped "${TARGET}" || if [ "${FORCE}" -eq "1" ]; then
check_target_is_stopped "${TARGET}" || if [ "${FORCE}" -eq 1 ]; then
bastille stop "${TARGET}"
else
exit
else
error_notify "Jail is running."
error_exit "Use [-f|--force] to force stop the jail."
fi

if [ -d "${bastille_jail_base}" ]; then
7 changes: 3 additions & 4 deletions usr/local/share/bastille/etcupdate.sh
Original file line number Diff line number Diff line change
@@ -31,12 +31,11 @@
. /usr/local/etc/bastille/bastille.conf

usage() {
error_exit "Usage: bastille etcupdate [option(s)] [TARGET|bootstrap RELEASE]"

error_notify "Usage: bastille etcupdate [option(s)] [TARGET|bootstrap RELEASE]"
cat << EOF
Options:

-d | --dry-run | -- Only show output of what etcupdate will do.
-d | --dry-run -- Only show output of what etcupdate will do.

EOF
exit 1
@@ -75,7 +74,7 @@ update_jail_etc() {
fi
}

if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
usage
fi

1 change: 0 additions & 1 deletion usr/local/share/bastille/export.sh
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@ usage() {
# Valid compress/options for non ZFS configured systems are .tgz and .txz
# If no compression option specified, user must redirect standard output
error_notify "Usage: bastille export | option(s) | TARGET | PATH"

cat << EOF
Options:

9 changes: 5 additions & 4 deletions usr/local/share/bastille/htop.sh
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@

usage() {
error_exit "Usage: bastille htop [option(s)] TARGET"

cat << EOF
Options:

@@ -71,16 +70,18 @@ TARGET="${1}"

bastille_root_check
set_target_single "${TARGET}"

info "[${TARGET}]:"
check_target_is_running "${TARGET}" || if [ "${FORCE}" -eq 1 ]; then
bastille start "${TARGET}"
else
exit
else
error_notify "Jail is not running."
error_continue "Use [-f|--force] to force start the jail."
fi

bastille_jail_path="${bastille_jailsdir}/${TARGET}/root"
if [ ! -x "${bastille_jail_path}/usr/local/bin/htop" ]; then
error_notify "htop not found on ${TARGET}."
elif [ -x "${bastille_jail_path}/usr/local/bin/htop" ]; then
info "[${TARGET}]:"
jexec -l ${TARGET} /usr/local/bin/htop
fi
1 change: 0 additions & 1 deletion usr/local/share/bastille/import.sh
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ usage() {
# Build an independent usage for the import command
# If no file/extension specified, will import from standard input
error_notify "Usage: bastille import [option(s)] FILE"

cat << EOF
Options:

16 changes: 12 additions & 4 deletions usr/local/share/bastille/limits.sh
Original file line number Diff line number Diff line change
@@ -33,8 +33,14 @@
. /usr/local/etc/bastille/bastille.conf

usage() {
error_notify "Usage: bastille limits TARGET OPTION VALUE"
error_notify "Usage: bastille limits [option(s)] TARGET OPTION VALUE"
echo -e "Example: bastille limits JAILNAME memoryuse 1G"
cat << EOF
Options:

-f | --force -- Start the jail if it is stopped.

EOF
exit 1
}

@@ -63,10 +69,12 @@ set_target "${TARGET}"
for _jail in ${JAILS}; do

info "[${_jail}]:"
check_target_is_running "${TARGET}" || if [ "${FORCE}" -eq 1 ]; then

check_target_is_running "${_jail}" || if [ "${FORCE}" -eq 1 ]; then
bastille start "${_jail}"
else
exit
else
error_notify "Jail is not running."
error_continue "Use [-f|--force] to force start the jail."
fi

_rctl_rule="jail:${_jail}:${OPTION}:deny=${VALUE}/jail"
Loading