Wait for fail2ban to reload

This commit is contained in:
Maniack Crudelis 2020-04-19 18:15:58 +02:00
parent 7cc04f5171
commit 23664c5036
2 changed files with 2 additions and 2 deletions

View file

@ -130,7 +130,7 @@ EOF
ynh_store_file_checksum "$finalfail2banjailconf"
ynh_store_file_checksum "$finalfail2banfilterconf"
ynh_systemd_action --service_name=fail2ban --action=reload
ynh_systemd_action --service_name=fail2ban --action=reload --line_match="(Started|Reloaded) Fail2Ban Service" --log_path=systemd
local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
if [[ -n "$fail2ban_error" ]]; then

View file

@ -133,7 +133,7 @@ ynh_systemd_action() {
for i in $(seq 1 $timeout)
do
# Read the log until the sentence is found, that means the app finished to start. Or run until the timeout
if grep --quiet "$line_match" "$templog"
if grep --extended-regexp --quiet "$line_match" "$templog"
then
ynh_print_info --message="The service $service_name has correctly executed the action ${action}."
break