304 |
|
|
305 |
|
void automount(set<string>& mounts) |
306 |
|
{ |
307 |
+ |
vector<string> args; |
308 |
+ |
|
309 |
+ |
args.push_back("spectre"); |
310 |
+ |
|
311 |
+ |
ipstream findsmb(config.findsmb, args); |
312 |
+ |
|
313 |
+ |
if (debug) cerr << "findsmb = {\n"; |
314 |
+ |
|
315 |
+ |
for (unsigned index = 0; index < 5; index++) |
316 |
+ |
{ |
317 |
+ |
string line; |
318 |
+ |
|
319 |
+ |
getline(findsmb, line); |
320 |
+ |
|
321 |
+ |
if (debug) cerr << line << "\n"; |
322 |
+ |
} |
323 |
+ |
|
324 |
+ |
set<string> hosts; |
325 |
+ |
|
326 |
+ |
automake(hosts, findsmb); |
327 |
+ |
|
328 |
+ |
if (debug) cerr << "}\n"; |
329 |
+ |
|
330 |
+ |
findsmb.close(); |
331 |
+ |
|
332 |
|
DIR* dir = opendir(config.root.c_str()); |
333 |
|
dirent* file; |
334 |
|
|
343 |
|
{ |
344 |
|
string folder = file->d_name; |
345 |
|
|
346 |
< |
if (folder == "." || folder == "..") continue; |
346 |
> |
if (folder == "." || folder == ".." || hosts.find(folder) == |
347 |
> |
hosts.end()) continue; |
348 |
|
|
349 |
|
mounts.insert(folder); |
350 |
|
} |