mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-20 17:20:12 +01:00
bastille: rename functions to "old" in place of new ones
Rename "check_target_is_running" and "target_all_jails" to have the suffix "_old". These two function are only ever called from within the main bastille executable. I am integrating these functions in "common.sh" so renaming them here for removal in the future is the best path forward.
This commit is contained in:
@@ -131,7 +131,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
|
||||||
@@ -142,7 +142,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
|
||||||
@@ -157,10 +157,10 @@ version|-v|--version)
|
|||||||
help|-h|--help)
|
help|-h|--help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
bootstrap|create|destroy|export|htop|import|list|mount|rdr|restart|setup|start|top|umount|update|upgrade|verify)
|
bootstrap|console|create|destroy|export|htop|import|list|mount|rdr|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)
|
clone|config|cmd|convert|cp|edit|limits|pkg|rcp|rename|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'
|
||||||
@@ -181,15 +181,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
|
||||||
@@ -205,8 +205,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
|
||||||
|
|||||||
Reference in New Issue
Block a user