Hello Salem
First thanks for your fast answer!
Snip GoodIP
root@mail:/etc/fail2ban# cat GoodIP
015.37.246.220
140.211.11.3
151.248.219.221
151.248.219.221
158.181.117.6
81.221.120.2
82.126.76.252
82.136.87.212
83.164.148.131
91.121.119.198
94.237.32.243
94.237.32.243
94.237.32.243
root@mail:/etc/fail2ban# cat GoodIP | wc -l
69
Snip ip.blacklist
root@mail:/etc/fail2ban# cat ip.blacklist
98.242.146.160
98.242.201.128
98.242.202.130
98.242.204.67
99.38.89.33
99.41.175.38
99.64.183.238
99.7.234.226
99.97.25.108
root@mail:/etc/fail2ban# cat ip.blacklist | wc -l
17002
But from where do the application know, which file this will pick to read?
Code:
#include <stdio.h>
int m
ain()
{
// 1. read file GoodIP.txt
FILE *myFile;
myFile = fopen(argv[1], "r");
// 2. read into array
int score[max];
for (i = 0; i < max; i++)
{
// 3. Print GoodIP from Array
printf("Number is: %d\n\n", max[i]);
return 0;
}
// 4. Service restart fail2ban
if [ $? -eq 0 ]; then
systemctl restart fail2ban
fi
}
regards
Mauri