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