Change start/stop script for fail2ban.
This commit is contained in:
@ -12,6 +12,10 @@
|
||||
|
||||
CONFIG_FILE=/etc/ipt-firewall/ipt-firewall-server.conf
|
||||
|
||||
if [[ -z "$fail2ban_client" ]]; then
|
||||
fail2ban_client="$(which fail2ban-client)"
|
||||
fi
|
||||
|
||||
|
||||
# ------------- Load Kernel Modules -------------
|
||||
#
|
||||
@ -177,9 +181,9 @@ fi
|
||||
|
||||
# ------------- Stop Fail2Ban if installed -------------
|
||||
#
|
||||
if [ -x "$fail2ban_init_script" ]; then
|
||||
if [ -x "$fail2ban_client" ]; then
|
||||
echononl "\tStopping fail2ban.."
|
||||
$fail2ban_init_script stop > /dev/null 2>&1
|
||||
$fail2ban_client stop > /dev/null 2>&1
|
||||
if [ "$?" = "0" ];then
|
||||
echo_done
|
||||
else
|
||||
@ -1551,13 +1555,14 @@ echo_done
|
||||
# -------------
|
||||
# ------------- Start Fail2Ban if installed
|
||||
# -------------
|
||||
|
||||
if [ -x "$fail2ban_init_script" ]; then
|
||||
if [ -x "$fail2ban_client" ]; then
|
||||
echo
|
||||
echononl "\tStarting fail2ban.."
|
||||
$fail2ban_init_script start > /dev/null 2>&1
|
||||
$fail2ban_client start > /dev/null 2>&1
|
||||
if [ "$?" = "0" ];then
|
||||
echo_done
|
||||
elif [ "$?" = "255" ]; then
|
||||
echo_skipped
|
||||
else
|
||||
echo_failed
|
||||
fi
|
||||
|
Reference in New Issue
Block a user