Merge pull request #292 from PetruGarstea/feature/rctl-logging
log rctl events to /var/log/messages
This commit is contained in:
@@ -62,13 +62,15 @@ for _jail in ${JAILS}; do
|
|||||||
info "[${_jail}]:"
|
info "[${_jail}]:"
|
||||||
|
|
||||||
_rctl_rule="jail:${_jail}:${OPTION}:deny=${VALUE}/jail"
|
_rctl_rule="jail:${_jail}:${OPTION}:deny=${VALUE}/jail"
|
||||||
|
_rctl_rule_log="jail:${_jail}:${OPTION}:log=${VALUE}/jail"
|
||||||
|
|
||||||
## if entry doesn't exist, add; else show existing entry
|
## if entry doesn't exist, add; else show existing entry
|
||||||
if ! grep -qs "${_rctl_rule}" "${bastille_jailsdir}/${_jail}/rctl.conf"; then
|
if ! grep -qs "${_rctl_rule}" "${bastille_jailsdir}/${_jail}/rctl.conf"; then
|
||||||
echo "${_rctl_rule}" >> "${bastille_jailsdir}/${_jail}/rctl.conf"
|
echo "${_rctl_rule}" >> "${bastille_jailsdir}/${_jail}/rctl.conf"
|
||||||
|
echo "${_rctl_rule_log}" >> "${bastille_jailsdir}/${_jail}/rctl.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${OPTION} ${VALUE}"
|
echo -e "${OPTION} ${VALUE}"
|
||||||
rctl -a "${_rctl_rule}"
|
rctl -a "${_rctl_rule}" "${_rctl_rule_log}"
|
||||||
echo -e "${COLOR_RESET}"
|
echo -e "${COLOR_RESET}"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user