Skip to content

Commit

Permalink
only accept one target for top
Browse files Browse the repository at this point in the history
  • Loading branch information
tschettervictor authored Dec 17, 2024
1 parent 0874e02 commit 42a6a29
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions usr/local/share/bastille/top.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,15 @@ case "${1}" in
;;
esac

if [ $# -eq 0 ]; then
usage
else
TARGET="${1}"
shift
fi

if [ "${TARGET}" = "ALL" ]; then
target_all_jails
else
check_target_exists "${TARGET}"
fi

if [ $# -ne 0 ]; then
# Accept only one argument
if [ $# -eq 0 ] || [ $# -gt 1 ]; then
usage
fi

set_target_single "${1}"
bastille_root_check

for _jail in ${JAILS}; do
for _jail in "${JAILS}"; do
check_target_is_running "${_jail}"
info "[${_jail}]:"
jexec -l "${_jail}" /usr/bin/top
Expand Down

0 comments on commit 42a6a29

Please sign in to comment.