mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-17 15:50:11 +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
|
||||
shift
|
||||
|
||||
target_all_jails() {
|
||||
target_all_jails_old() {
|
||||
_JAILS=$(/usr/sbin/jls name)
|
||||
JAILS=""
|
||||
for _jail in ${_JAILS}; do
|
||||
@@ -142,7 +142,7 @@ target_all_jails() {
|
||||
done
|
||||
}
|
||||
|
||||
check_target_is_running() {
|
||||
check_target_is_running_old() {
|
||||
if [ ! "$(/usr/sbin/jls name | awk "/^${TARGET}$/")" ]; then
|
||||
error_exit "[${TARGET}]: Not started. See 'bastille start ${TARGET}'."
|
||||
fi
|
||||
@@ -157,10 +157,10 @@ version|-v|--version)
|
||||
help|-h|--help)
|
||||
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
|
||||
;;
|
||||
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
|
||||
if [ $# -eq 0 ]; then # No target was given, so show the command's help. -- cwells
|
||||
PARAMS='help'
|
||||
@@ -181,15 +181,15 @@ clone|config|cmd|console|convert|cp|edit|limits|pkg|rcp|rename|service|stop|sysr
|
||||
fi
|
||||
|
||||
if [ "${TARGET}" = 'ALL' ]; then
|
||||
target_all_jails
|
||||
target_all_jails_old
|
||||
elif [ "${CMD}" = "pkg" ] && [ "${TARGET}" = '-H' ] || [ "${TARGET}" = '--host' ]; then
|
||||
TARGET="${1}"
|
||||
USE_HOST_PKG=1
|
||||
if [ "${TARGET}" = 'ALL' ]; then
|
||||
target_all_jails
|
||||
target_all_jails_old
|
||||
else
|
||||
JAILS="${TARGET}"
|
||||
check_target_is_running
|
||||
check_target_is_running_old
|
||||
fi
|
||||
shift
|
||||
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
|
||||
|
||||
case "${CMD}" in
|
||||
cmd|console|pkg|service|stop|sysrc|template)
|
||||
check_target_is_running
|
||||
cmd|pkg|service|stop|sysrc|template)
|
||||
check_target_is_running_old
|
||||
;;
|
||||
convert|rename)
|
||||
# Require the target to be stopped. -- cwells
|
||||
|
||||
Reference in New Issue
Block a user