From bc4a742e32f610879fcdb1af7677e46007ac0682 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 15 Jul 2018 13:13:13 -0400 Subject: [PATCH] files/fail2ban-openrc.init: replace FAIL2BAN with standard OpenRC variables. The FAIL2BAN variable in our OpenRC service script was a combination of two standard OpenRC variables, "command" and "command_args". This commit simply replaces the custom variable with the two standard ones. This will aid future simplifications of the service script. --- files/fail2ban-openrc.init | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/files/fail2ban-openrc.init b/files/fail2ban-openrc.init index 138bff30..1374da3d 100755 --- a/files/fail2ban-openrc.init +++ b/files/fail2ban-openrc.init @@ -23,7 +23,8 @@ description_reload="reload configuration" description_showlog="show fail2ban logs" extra_started_commands="reload showlog" -FAIL2BAN="/usr/bin/fail2ban-client ${FAIL2BAN_OPTIONS}" +command="/usr/bin/fail2ban-client" +command_args="${FAIL2BAN_OPTIONS}" depend() { use logger @@ -37,20 +38,20 @@ start() { # bug 347477 rm -f /var/run/fail2ban/fail2ban.sock || return 1 start-stop-daemon --start --pidfile /var/run/fail2ban/fail2ban.pid \ - -- ${FAIL2BAN} start + -- ${command} ${command_args} start eend $? "Failed to start fail2ban" } stop() { ebegin "Stopping fail2ban" start-stop-daemon --stop --pidfile /var/run/fail2ban/fail2ban.pid --retry 30 \ - -- ${FAIL2BAN} stop + -- ${command} ${command_args} stop eend $? "Failed to stop fail2ban" } reload() { ebegin "Reloading fail2ban" - ${FAIL2BAN} reload + ${command} ${command_args} reload eend $? "Failed to reload fail2ban" }