From 0d9a793ed9026febf56907e9c2a37401cda97e13 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:21:17 -0700 Subject: [PATCH] Update top.sh --- usr/local/share/bastille/top.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr/local/share/bastille/top.sh b/usr/local/share/bastille/top.sh index 351a2dfe..7cc4713a 100644 --- a/usr/local/share/bastille/top.sh +++ b/usr/local/share/bastille/top.sh @@ -53,6 +53,11 @@ set_target_single "${TARGET}" check_target_exists "${TARGET}" check_target_is_running "${TARGET}" -info "[${TARGET}]:" -jexec -l "${TARGET}" /usr/bin/top +bastille_jail_path="$(/usr/sbin/jls -j "${TARGET}" path)" +if [ ! -x "${bastille_jail_path}/usr/local/bin/top" ]; then + error_notify "top not found on ${TARGET}." +elif [ -x "${bastille_jail_path}/usr/local/bin/top" ]; then + info "[${TARGET}]:" + jexec -l "${TARGET}" /usr/local/bin/htop +fi echo -e "${COLOR_RESET}"