]> andersk Git - moira.git/commitdiff
Take command-line argument with name of file to generate.
authorzacheiss <zacheiss>
Tue, 3 Apr 2007 20:52:58 +0000 (20:52 +0000)
committerzacheiss <zacheiss>
Tue, 3 Apr 2007 20:52:58 +0000 (20:52 +0000)
gen/dhcp.pc

index 8ece8a4778f4df141f4512b5b80745d070271bd8..31c49cc1f0875161fb2b9172441fde0cdc098d5a 100644 (file)
@@ -62,6 +62,12 @@ int main(int argc, char **argv)
 
   EXEC SQL WHENEVER SQLERROR DO sqlerr();
 
+  if (argc != 2)
+    {
+      fprintf(stderr, "usage: %s [outfile]\n", argv[0]);
+      exit(MR_ARGS);
+    }
+
   /* Get print spoolers for allow lists. */
   EXEC SQL SELECT COUNT(service) INTO :alcount FROM serverhosts sh, machine m
     WHERE sh.service = 'PRINT' AND sh.mach_id = m.mach_id 
@@ -84,8 +90,7 @@ int main(int argc, char **argv)
   EXEC SQL CLOSE csr_spool;
 
   /* Now build the tar file. */
-  sprintf(filename, "%s/dhcp.out", DCM_DIR);
-  tf = tarfile_open(filename);
+  tf = tarfile_open(argv[1]);
 
   /* Build dhcpd.conf.print */
 
This page took 0.095148 seconds and 5 git commands to generate.