mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-22 10:10:46 +01:00
Update bastille: Rebar
This commit is contained in:
@@ -78,7 +78,7 @@ bastille_perms_check() {
|
|||||||
bastille_perms_check
|
bastille_perms_check
|
||||||
|
|
||||||
## version
|
## version
|
||||||
BASTILLE_VERSION="0.12.20250111"
|
BASTILLE_VERSION="0.13.20250126"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@@ -95,19 +95,21 @@ Available Commands:
|
|||||||
config Get or set a config value for the targeted container(s).
|
config Get or set a config value for the targeted container(s).
|
||||||
console Console into a running container.
|
console Console into a running container.
|
||||||
convert Convert a Thin container into a Thick container.
|
convert Convert a Thin container into a Thick container.
|
||||||
cp cp(1) files from host to targeted container(s).
|
cp cp(1) files from host to jail(s).
|
||||||
create Create a new thin container or a thick container if -T|--thick option specified.
|
create Create a new thin container or a thick container if -T|--thick option specified.
|
||||||
destroy Destroy a stopped container or a FreeBSD release.
|
destroy Destroy a stopped container or a FreeBSD release.
|
||||||
edit Edit container configuration files (advanced).
|
edit Edit container configuration files (advanced).
|
||||||
|
etcupdate Update /etc directory to specified release.
|
||||||
export Exports a specified container.
|
export Exports a specified container.
|
||||||
help Help about any command.
|
help Help about any command.
|
||||||
htop Interactive process viewer (requires htop).
|
htop Interactive process viewer (requires htop).
|
||||||
|
jcp cp(1) files from a jail to jail(s).
|
||||||
import Import a specified container.
|
import Import a specified container.
|
||||||
limits Apply resources limits to targeted container(s). See rctl(8).
|
limits Apply resources limits to targeted container(s). See rctl(8).
|
||||||
list List containers (running).
|
list List containers (running).
|
||||||
mount Mount a volume inside the targeted container(s).
|
mount Mount a volume inside the targeted container(s).
|
||||||
pkg Manipulate binary packages within targeted container(s). See pkg(8).
|
pkg Manipulate binary packages within targeted container(s). See pkg(8).
|
||||||
rcp reverse cp(1) files from a single container to the host.
|
rcp cp(1) files from a jail to host.
|
||||||
rdr Redirect host port to container port.
|
rdr Redirect host port to container port.
|
||||||
rename Rename a container.
|
rename Rename a container.
|
||||||
restart Restart a running container.
|
restart Restart a running container.
|
||||||
@@ -137,7 +139,7 @@ EOF
|
|||||||
CMD=$1
|
CMD=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
target_all_jails() {
|
target_all_jails_old() {
|
||||||
_JAILS=$(/usr/sbin/jls name)
|
_JAILS=$(/usr/sbin/jls name)
|
||||||
JAILS=""
|
JAILS=""
|
||||||
for _jail in ${_JAILS}; do
|
for _jail in ${_JAILS}; do
|
||||||
@@ -148,7 +150,7 @@ target_all_jails() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
check_target_is_running() {
|
check_target_is_running_old() {
|
||||||
if [ ! "$(/usr/sbin/jls name | awk "/^${TARGET}$/")" ]; then
|
if [ ! "$(/usr/sbin/jls name | awk "/^${TARGET}$/")" ]; then
|
||||||
error_exit "[${TARGET}]: Not started. See 'bastille start ${TARGET}'."
|
error_exit "[${TARGET}]: Not started. See 'bastille start ${TARGET}'."
|
||||||
fi
|
fi
|
||||||
@@ -163,10 +165,10 @@ version|-v|--version)
|
|||||||
help|-h|--help)
|
help|-h|--help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
bootstrap|create|destroy|export|htop|import|list|mount|network|rdr|restart|setup|start|top|umount|update|upgrade|verify)
|
bootstrap|clone|console|create|cp|destroy|etcupdate|export|htop|import|jcp|list|mount|network|pkg|rcp|rdr|rename|restart|setup|start|top|umount|update|upgrade|verify)
|
||||||
# Nothing "extra" to do for these commands. -- cwells
|
# Nothing "extra" to do for these commands. -- cwells
|
||||||
;;
|
;;
|
||||||
clone|config|cmd|console|convert|cp|edit|limits|pkg|rcp|rename|service|stop|sysrc|tags|template|zfs)
|
config|cmd|convert|edit|limits|service|stop|sysrc|tags|template|zfs)
|
||||||
# Parse the target and ensure it exists. -- cwells
|
# Parse the target and ensure it exists. -- cwells
|
||||||
if [ $# -eq 0 ]; then # No target was given, so show the command's help. -- cwells
|
if [ $# -eq 0 ]; then # No target was given, so show the command's help. -- cwells
|
||||||
PARAMS='help'
|
PARAMS='help'
|
||||||
@@ -187,15 +189,15 @@ clone|config|cmd|console|convert|cp|edit|limits|pkg|rcp|rename|service|stop|sysr
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${TARGET}" = 'ALL' ]; then
|
if [ "${TARGET}" = 'ALL' ]; then
|
||||||
target_all_jails
|
target_all_jails_old
|
||||||
elif [ "${CMD}" = "pkg" ] && [ "${TARGET}" = '-H' ] || [ "${TARGET}" = '--host' ]; then
|
elif [ "${CMD}" = "pkg" ] && [ "${TARGET}" = '-H' ] || [ "${TARGET}" = '--host' ]; then
|
||||||
TARGET="${1}"
|
TARGET="${1}"
|
||||||
USE_HOST_PKG=1
|
USE_HOST_PKG=1
|
||||||
if [ "${TARGET}" = 'ALL' ]; then
|
if [ "${TARGET}" = 'ALL' ]; then
|
||||||
target_all_jails
|
target_all_jails_old
|
||||||
else
|
else
|
||||||
JAILS="${TARGET}"
|
JAILS="${TARGET}"
|
||||||
check_target_is_running
|
check_target_is_running_old
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
elif [ "${CMD}" = 'template' ] && [ "${TARGET}" = '--convert' ]; then
|
elif [ "${CMD}" = 'template' ] && [ "${TARGET}" = '--convert' ]; then
|
||||||
@@ -211,8 +213,8 @@ clone|config|cmd|console|convert|cp|edit|limits|pkg|rcp|rename|service|stop|sysr
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "${CMD}" in
|
case "${CMD}" in
|
||||||
cmd|console|pkg|service|stop|sysrc|template)
|
cmd|pkg|service|stop|sysrc|template)
|
||||||
check_target_is_running
|
check_target_is_running_old
|
||||||
;;
|
;;
|
||||||
convert|rename)
|
convert|rename)
|
||||||
# Require the target to be stopped. -- cwells
|
# Require the target to be stopped. -- cwells
|
||||||
@@ -247,4 +249,4 @@ if [ -f "${SCRIPTPATH}" ]; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
error_exit "${SCRIPTPATH} not found."
|
error_exit "${SCRIPTPATH} not found."
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user