From 5bc7cd8c738d9c70c1938a804e94381a48ab59ca Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:24:46 -0700 Subject: [PATCH] begin function define in top --- usr/local/share/bastille/top.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/usr/local/share/bastille/top.sh b/usr/local/share/bastille/top.sh index 1e8cbb9c..7c319ed3 100644 --- a/usr/local/share/bastille/top.sh +++ b/usr/local/share/bastille/top.sh @@ -35,12 +35,22 @@ usage() { } # Handle special-case commands first. -case "$1" in -help|-h|--help) - usage - ;; +case "${1}" in + help|-h|--help) + usage + ;; esac +TARGET="${1}" +shift + +if [ "${TARGET}" = "ALL" ]; then + target_all_jails +else + check_jail_exists "${TARGET}" + check_target_is_running "${TARGET}" +fi + if [ $# -ne 0 ]; then usage fi