|
|
|
@ -613,18 +613,27 @@ inline bool findIpInFile(const char *filename, string ip)
|
|
|
|
|
ifstream File(filename);
|
|
|
|
|
if(!File.is_open())
|
|
|
|
|
{
|
|
|
|
|
cout << "error while opening file" << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string line = "";
|
|
|
|
|
int iFound = 0;
|
|
|
|
|
while(getline(File, line))
|
|
|
|
|
{
|
|
|
|
|
if(boost::iequals(ip, line) == true)
|
|
|
|
|
{
|
|
|
|
|
//cout << ip << " found in " << filename << "!" << endl;
|
|
|
|
|
//cout << ip << " found in " << filename << endl;
|
|
|
|
|
cout << "Found." << endl;
|
|
|
|
|
iFound = 1;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(iFound == 0)
|
|
|
|
|
{
|
|
|
|
|
cout << "Not found." << endl;
|
|
|
|
|
//cout << ip << " not found in " << filename << endl;
|
|
|
|
|
}
|
|
|
|
|
File.close();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|