mirror of
https://github.com/hackacad/bastille.git
synced 2026-03-25 10:14:59 +01:00
monitor: suppress more errors
This commit is contained in:
@@ -144,7 +144,7 @@ for _jail in ${JAILS}; do
|
||||
add)
|
||||
[ -z "${SERVICE}" ] && usage
|
||||
for _service in $(echo "${SERVICE}" | tr , ' '); do
|
||||
if ! grep -qE "^${_service}\$" "${bastille_jail_monitor}" 2>/dev/null 2>&1; then
|
||||
if ! grep -qEs "^${_service}\$" "${bastille_jail_monitor}" 2>/dev/null 2>&1; then
|
||||
echo "${_service}" >> "${bastille_jail_monitor}"
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S'): Added monitor for ${_service} on ${_jail}" >> "${bastille_monitor_logfile}"
|
||||
fi
|
||||
@@ -154,7 +154,7 @@ for _jail in ${JAILS}; do
|
||||
[ -z "${SERVICE}" ] && usage
|
||||
for _service in $(echo "${SERVICE}" | tr , ' '); do
|
||||
[ ! -f "${bastille_jail_monitor}" ] && break # skip if no monitor file
|
||||
if grep -qE "^${_service}\$" "${bastille_jail_monitor}" 2>/dev/null 2>&1; then
|
||||
if grep -qEs "^${_service}\$" "${bastille_jail_monitor}" 2>/dev/null 2>&1; then
|
||||
sed -i '' "/^${_service}\$/d" "${bastille_jail_monitor}"
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S'): Removed monitor for ${_service} on ${_jail}" >> "${bastille_monitor_logfile}"
|
||||
fi
|
||||
@@ -168,7 +168,7 @@ for _jail in ${JAILS}; do
|
||||
usage # Only one service per query
|
||||
fi
|
||||
[ ! -f "${bastille_jail_monitor}" ] && continue # skip if there is no monitor file
|
||||
if grep -qE "^${SERVICE}\$" "${bastille_jail_monitor}" 2>/dev/null 2>&1; then
|
||||
if grep -qEs "^${SERVICE}\$" "${bastille_jail_monitor}" 2>/dev/null 2>&1; then
|
||||
echo "${_jail}"
|
||||
continue
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user