mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-21 01:30:52 +01:00
Update limits.sh
This commit is contained in:
@@ -170,24 +170,27 @@ for _jail in ${JAILS}; do
|
|||||||
if grep -qs "jail:${_jail}:${OPTION}:deny" "${bastille_jailsdir}/${_jail}/rctl.conf"; then
|
if grep -qs "jail:${_jail}:${OPTION}:deny" "${bastille_jailsdir}/${_jail}/rctl.conf"; then
|
||||||
_escaped_option=$(echo "${OPTION}" | sed 's/\//\\\//g')
|
_escaped_option=$(echo "${OPTION}" | sed 's/\//\\\//g')
|
||||||
_escaped_rctl_rule=$(echo "${_rctl_rule}" | sed 's/\//\\\//g')
|
_escaped_rctl_rule=$(echo "${_rctl_rule}" | sed 's/\//\\\//g')
|
||||||
|
_escaped_rctl_rule_log=$(echo "${_rctl_rule_log}" | sed 's/\//\\\//g')
|
||||||
sed -i '' -E "s/jail:${_jail}:${_escaped_option}:deny.+/${_escaped_rctl_rule}/" "${bastille_jailsdir}/${_jail}/rctl.conf"
|
sed -i '' -E "s/jail:${_jail}:${_escaped_option}:deny.+/${_escaped_rctl_rule}/" "${bastille_jailsdir}/${_jail}/rctl.conf"
|
||||||
|
if [ "${OPT_LOG}" -eq 1 ]; then
|
||||||
|
sed -i '' -E "s/jail:${_jail}:${_escaped_option}:log.+/${_escaped_rctl_rule_log}/" "${bastille_jailsdir}/${_jail}/rctl.conf"
|
||||||
|
fi
|
||||||
else # Just append the entry. -- cwells
|
else # Just append the entry. -- cwells
|
||||||
echo "${_rctl_rule}" >> "${bastille_jailsdir}/${_jail}/rctl.conf"
|
echo "${_rctl_rule}" >> "${bastille_jailsdir}/${_jail}/rctl.conf"
|
||||||
echo -e "${OPTION} ${VALUE}"
|
|
||||||
rctl -a "${_rctl_rule}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${OPT_LOG}" -eq 1 ]; then
|
if [ "${OPT_LOG}" -eq 1 ]; then
|
||||||
if grep -qs "jail:${_jail}:${OPTION}:deny" "${bastille_jailsdir}/${_jail}/rctl.conf"; then
|
|
||||||
_escaped_option=$(echo "${OPTION}" | sed 's/\//\\\//g')
|
|
||||||
_escaped_rctl_rule_log=$(echo "${_rctl_rule_log}" | sed 's/\//\\\//g')
|
|
||||||
sed -i '' -E "s/jail:${_jail}:${_escaped_option}:log.+/${_escaped_rctl_rule_log}/" "${bastille_jailsdir}/${_jail}/rctl.conf"
|
|
||||||
else # Just append the entry. -- cwells
|
|
||||||
echo "${_rctl_rule_log}" >> "${bastille_jailsdir}/${_jail}/rctl.conf"
|
echo "${_rctl_rule_log}" >> "${bastille_jailsdir}/${_jail}/rctl.conf"
|
||||||
fi
|
fi
|
||||||
|
if [ "${OPT_LOG}" -eq 1 ]; then
|
||||||
echo -e "[LOGGING]: ${OPTION} ${VALUE}"
|
echo -e "[LOGGING]: ${OPTION} ${VALUE}"
|
||||||
|
else
|
||||||
|
echo -e "${OPTION} ${VALUE}"
|
||||||
|
fi
|
||||||
|
rctl -a "${_rctl_rule}"
|
||||||
|
if [ "${OPT_LOG}" -eq 1 ]; then
|
||||||
rctl -a "${_rctl_rule_log}"
|
rctl -a "${_rctl_rule_log}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
remove)
|
remove)
|
||||||
|
|||||||
Reference in New Issue
Block a user