mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-24 19:22:26 +01:00
limits: Add show and stats
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user