File tree Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -266,15 +266,35 @@ string DLNotifyHostHandler(const vector<string>&parts, Utility::pid_t ppid)
266
266
string DLNotifyHandler (const vector<string>&parts, Utility::pid_t ppid)
267
267
{
268
268
extern CommunicatorClass Communicator;
269
- ostringstream os ;
269
+ UeberBackend B ;
270
270
if (parts.size ()!=2 )
271
271
return " syntax: notify domain" ;
272
272
if (!::arg ().mustDo (" master" ))
273
273
return " PowerDNS not configured as master" ;
274
274
L<<Logger::Warning<<" Notification request for domain '" <<parts[1 ]<<" ' received from operator" <<endl;
275
- if (!Communicator.notifyDomain (parts[1 ]))
276
- return " Failed to add to the queue - see log" ;
277
- return " Added to queue" ;
275
+
276
+ if (parts[1 ] == " *" ) {
277
+ vector<DomainInfo> domains;
278
+ B.getAllDomains (&domains);
279
+
280
+ int total = 0 ;
281
+ int notified = 0 ;
282
+ for (vector<DomainInfo>::const_iterator di=domains.begin (); di != domains.end (); di++) {
283
+ if (di->kind == 0 ) { // MASTER
284
+ total++;
285
+ if (Communicator.notifyDomain (di->zone ))
286
+ notified++;
287
+ }
288
+ }
289
+
290
+ if (total != notified)
291
+ return itoa (notified)+" out of " +itoa (total)+" zones added to queue - see log" ;
292
+ return " Added " +itoa (total)+" MASTER zones to queue" ;
293
+ } else {
294
+ if (!Communicator.notifyDomain (parts[1 ]))
295
+ return " Failed to add to the queue - see log" ;
296
+ return " Added to queue" ;
297
+ }
278
298
}
279
299
280
300
string DLRediscoverHandler (const vector<string>&parts, Utility::pid_t ppid)
You can’t perform that action at this time.
0 commit comments