From 55d98b00b3499e96641936c09f807bd4b6d3cc22 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:13:26 +0000 Subject: [PATCH] Fixed fail2ban issue --- .../run_onchange_after_31-fail2ban.sh.tmpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_31-fail2ban.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_31-fail2ban.sh.tmpl index 9feda50e..1f221abe 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_31-fail2ban.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_31-fail2ban.sh.tmpl @@ -21,7 +21,7 @@ logg info 'Configuring fail2ban' ### Restart fail2ban -function restartFail2Ban() { +function restartFailToBan() { if [ -d /Applications ] && [ -d /System ]; then # macOS logg info 'Enabling the fail2ban Homebrew service' @@ -41,17 +41,17 @@ if [[ ! "$(test -d /proc && grep Microsoft /proc/version > /dev/null)" ]]; then if [ -d /etc/fail2ban ]; then logg info 'Copying ~/.ssh/fail2ban/jail.local to /etc/fail2ban/jail.local' sudo cp -f "$HOME/.ssh/fail2ban/jail.local" /etc/fail2ban/jail.local - restartFail2Ban + restartFailToBan elif [ -d /usr/local/etc/fail2ban ]; then logg info 'Copying ~/.ssh/fail2ban/jail.local to /usr/local/etc/fail2ban/jail.local' sudo cp -f "$HOME/.ssh/fail2ban/jail.local" /usr/local/etc/fail2ban/jail.local - restartFail2Ban - elif [ -d "$HOMEBREW_PREFIX/etc/fail2ban" ]; then - logg info "Copying ~/.ssh/fail2ban/jail.local to $HOMEBREW_PREFIX/etc/fail2ban/jail.local" - sudo cp -f "$HOME/.ssh/fail2ban/jail.local" "$HOMEBREW_PREFIX/etc/fail2ban/jail.local" - restartFail2Ban + restartFailToBan + elif [ -d "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/fail2ban" ]; then + logg info "Copying ~/.ssh/fail2ban/jail.local to ${HOMEBREW_PREFIX:-/opt/homebrew}/etc/fail2ban/jail.local" + sudo cp -f "$HOME/.ssh/fail2ban/jail.local" "${HOMEBREW_PREFIX:-/opt/homebrew}/etc/fail2ban/jail.local" + restartFailToBan else - logg warn 'Both the /etc/fail2ban (Linux) and the /usr/local/etc/fail2ban (macOS) folder do not exist' + logg warn 'The /etc/fail2ban (Linux), the /usr/local/etc/fail2ban, and the ${HOMEBREW_PREFIX:-/opt/homebrew}/etc/fail2ban (macOS) folder do not exist' fi else logg info 'Skipping sshd_config application since environment is WSL'