const vector<string>&commands=arg().getCommands();
string command;
- string password;
int fd = -1;
unsigned int i = 0;
while (i < commands.size()) {
else if (commands.at(i) == "hash-password") {
if (commands.size() > (i + 1)) {
++i;
- password = commands.at(i);
+ auto password = commands.at(i);
+ cout << hashPassword(password) << endl;
+ return 0;
}
else {
throw PDNSException("Command needs a password argument");
++i;
}
- if (!password.empty()) {
- cout << hashPassword(password) << endl;
- return 0;
- }
-
auto timeout = arg().asNum("timeout");
RecursorControlChannel rccS;
rccS.connect(arg()["socket-dir"], sockname);