]> granicus.if.org Git - pdns/commitdiff
expand pdnsutil load-zone so it can load multiple zone/filename pairs in one go
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 5 Feb 2019 16:38:31 +0000 (17:38 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 5 Feb 2019 16:47:25 +0000 (17:47 +0100)
pdns/pdnsutil.cc

index 46cde8ac6262307529c0ac2f521d17f560e729bc..9775b42a8f4f30053812dcd999aafd8d86879fa2 100644 (file)
@@ -2363,14 +2363,16 @@ try
     exit(listKeys(zname, dk));
   }
   else if(cmds[0] == "load-zone") {
-    if(cmds.size() != 3) {
-      cerr<<"Syntax: pdnsutil load-zone ZONE FILENAME"<<endl;
+    if(cmds.size() < 3) {
+      cerr<<"Syntax: pdnsutil load-zone ZONE FILENAME [ZONE FILENAME] .."<<endl;
       return 0;
     }
     if(cmds[1]==".")
       cmds[1].clear();
 
-    exit(loadZone(DNSName(cmds[1]), cmds[2]));
+    for(int n=1; n + 2 <= cmds.size(); n+=2)
+      loadZone(DNSName(cmds[n]), cmds[n+1]);
+    return 0;
   }
   else if(cmds[0] == "secure-zone") {
     if(cmds.size() < 2) {