Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tschettervictor authored Dec 19, 2024
1 parent 5b68630 commit 200321c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions usr/local/share/bastille/top.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ case "${1}" in
;;
esac

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

TARGET="${1}"

bastille_root_check
set_target_single "${TARGET}"
check_target_exists "${TARGET}"
check_target_is_running "${TARGET}"
check_target_is_running "${TARGET}" || exit

bastille_jail_path="$(/usr/sbin/jls -j "${TARGET}" path)"
if [ ! -x "${bastille_jail_path}/usr/local/bin/top" ]; then
Expand Down

0 comments on commit 200321c

Please sign in to comment.