From 7998bee50e626e04782e07cbb72adeb983444988 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Mon, 20 May 2019 18:03:25 -0600 Subject: [PATCH] fix errant F2B-DIR var name and add debug output --- f2b-config.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/f2b-config.sh b/f2b-config.sh index 48464c9..c5be41b 100644 --- a/f2b-config.sh +++ b/f2b-config.sh @@ -54,7 +54,8 @@ fi ### default values for variables -F2B-DIR='/etc/fail2ban' +F2B_DIR="$1" +echo "(testing: base-dir is: ${F2B_DIR})" ### user info preamble @@ -81,28 +82,28 @@ echo # note: prefixing cp with '\' to override any alias settings # copy .local files if [ "$(\cp --force --backup=simple --suffix=.original \ - etc/fail2ban/*.local "${F2B-DIR}/")" -ne 0 ]; then + etc/fail2ban/*.local "${F2B_DIR}/")" -ne 0 ]; then copyFailure 'general config files (.local)' fi echo -e "${info}Copy general configuration files${normal} -- ${ok}[OK]${normal}" # copy action configuration files if [ "$(\cp --force --backup=simple --suffix=.original \ - etc/fail2ban/action.d/* "${F2B-DIR}/action.d/")" -ne 0 ]; then + etc/fail2ban/action.d/* "${F2B_DIR}/action.d/")" -ne 0 ]; then copyFailure 'action files' fi echo -e "${info}Copy action configuration files${normal} -- ${ok}[OK]${normal}" # copy filter configuration files if [ "$(\cp --force --backup=simple --suffix=.original \ - etc/fail2ban/filter.d/* "${F2B-DIR}/filter.d/")" -ne 0 ]; then + etc/fail2ban/filter.d/* "${F2B_DIR}/filter.d/")" -ne 0 ]; then copyFailure 'filter files' fi echo -e "${info}Copy filter configuration files${normal} -- ${ok}[OK]${normal}" # copy jail configuration files if [ "$(\cp --force --backup=simple --suffix=.original \ - etc/fail2ban/jail.d/* "${F2B-DIR}/jail.d/")" -ne 0 ]; then + etc/fail2ban/jail.d/* "${F2B_DIR}/jail.d/")" -ne 0 ]; then copyFailure 'jail files' fi echo -e "${info}Copy jail configuration files${normal} -- ${ok}[OK]${normal}"