|
76 | 76 | echo -e $'\nLoading...' |
77 | 77 | if [ ! -f $F2B ]; then |
78 | 78 | 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 |
90 | 96 | else |
91 | | - printf "\n${COL_YLW}###########\n# ${COL_RED}WARNING ${COL_YLW}#\n###########\n\n${COL_RST}" |
92 | | - printf "File was not found!\n" |
93 | 97 | exit |
94 | 98 | fi |
95 | 99 | else |
96 | | - exit |
| 100 | + exit |
97 | 101 | fi |
98 | 102 | else |
99 | 103 | printf "\n${COL_YLW}########\n# ${COL_BLE}INFO ${COL_YLW}#\n########\n\n${COL_RST}" |
|
0 commit comments