From 9d235fa1a4e0a43f71ecc8842c2f762660ff744b Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 22 Mar 2025 18:44:21 -0600 Subject: [PATCH] limits: Add show and stats --- usr/local/share/bastille/limits.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/usr/local/share/bastille/limits.sh b/usr/local/share/bastille/limits.sh index 28f1aa68..8b639aa8 100644 --- a/usr/local/share/bastille/limits.sh +++ b/usr/local/share/bastille/limits.sh @@ -35,7 +35,7 @@ . /usr/local/etc/bastille/bastille.conf usage() { - error_notify "Usage: bastille limits [option(s)] TARGET [OPTION VALUE|clear|reset]" + error_notify "Usage: bastille limits [option(s)] TARGET [OPTION VALUE|clear|reset|show|stats]" echo -e "Example: bastille limits TARGET memoryuse 1G" cat << EOF Options: @@ -114,6 +114,18 @@ for _jail in ${JAILS}; do info "[${TARGET}]: RCTL limits cleared." fi ;; + show) + # Show limits + if [ -s "${bastille_jailsdir}/${_jail}/rctl.conf" ]; then + rctl jail:${_jail} 2>/dev/null + fi + ;; + stats) + # Show statistics + if [ -s "${bastille_jailsdir}/${_jail}/rctl.conf" ]; then + rctl -hu jail:${_jail} 2>/dev/null + fi + ;; reset) # Remove limits and delete rctl.conf if [ -s "${bastille_jailsdir}/${_jail}/rctl.conf" ]; then