Skip to content

Commit 40e56ab

Browse files
authored
force bypasses search now
1 parent 3bd2a0b commit 40e56ab

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

fail2ban.sh

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,28 @@ done
7676
echo -e $'\nLoading...'
7777
if [ ! -f $F2B ]; then
7878
if [ ! -f $DEF ]; then
79-
printf "\n${COL_YLW}#########\n# ${COL_RED}ERROR ${COL_YLW}#\n#########\n\n${COL_RST}"
80-
printf "File not found!\nCheck the path in the script\n\nOr do you want me to search for the log? [y/n]\n\n"
81-
stty_cfg=$(stty -g)
82-
stty raw -echo ; input=$(head -c 1) ; stty $stty_cfg
83-
if echo "$input" | grep -iq "^y" ;then
84-
printf "${COL_YLW}Searching... (Could take some time)${COL_RST}\n"
85-
LOC=$(find / -type f -iname "fail2ban.log")
86-
if [ "$LOC" '!=' '' ]; then
87-
printf "\n${COL_YLW}########\n# ${COL_BLE}INFO ${COL_YLW}#\n########\n\n${COL_GRN}"
88-
printf "File was found at %s!\n${COL_RST}" $LOC
89-
F2B=$LOC
79+
if [[ $frc != 1 ]]; then
80+
printf "\n${COL_YLW}#########\n# ${COL_RED}ERROR ${COL_YLW}#\n#########\n\n${COL_RST}"
81+
printf "File not found!\nCheck the path in the script\n\nOr do you want me to search for the log? [y/n]\n\n${COL_RST}"
82+
stty_cfg=$(stty -g)
83+
stty raw -echo ; input=$(head -c 1) ; stty $stty_cfg
84+
if echo "$input" | grep -iq "^y" ;then
85+
printf "${COL_YLW}Searching... (Could take some time)${COL_RST}\n"
86+
LOC=$(find / -type f -iname "fail2ban.log")
87+
if [ "$LOC" '!=' '' ]; then
88+
printf "\n${COL_YLW}########\n# ${COL_BLE}INFO ${COL_YLW}#\n########\n\n${COL_GRN}"
89+
printf "File was found at %s!\n${COL_RST}" $LOC
90+
F2B=$LOC
91+
else
92+
printf "\n${COL_YLW}###########\n# ${COL_RED}WARNING ${COL_YLW}#\n###########\n\n${COL_RST}"
93+
printf "File was not found!\n"
94+
exit
95+
fi
9096
else
91-
printf "\n${COL_YLW}###########\n# ${COL_RED}WARNING ${COL_YLW}#\n###########\n\n${COL_RST}"
92-
printf "File was not found!\n"
9397
exit
9498
fi
9599
else
96-
exit
100+
exit
97101
fi
98102
else
99103
printf "\n${COL_YLW}########\n# ${COL_BLE}INFO ${COL_YLW}#\n########\n\n${COL_RST}"

0 commit comments

Comments
 (0)