]> andersk Git - moira.git/commitdiff
only output the printer's hostname.
authorjweiss <jweiss>
Tue, 28 Aug 2001 02:38:20 +0000 (02:38 +0000)
committerjweiss <jweiss>
Tue, 28 Aug 2001 02:38:20 +0000 (02:38 +0000)
gen/spwatch.gen

index 6443f149aa7709b45104cd91ef30551fb4de6e3f..23feef07fd0d62467b850d066d4d25e7e1e3689e 100755 (executable)
@@ -13,18 +13,19 @@ use DBI;
 $dbh = DBI->connect("dbi:Oracle:moira", "moira", "moira")
     || exit $MR_DBMS_ERR;
 
-$sth = $dbh->prepare("SELECT p.name, m.name, p.location FROM printers p, ".
+$sth = $dbh->prepare("SELECT m.name FROM printers p, ".
                     "machine m WHERE p.type = 'SAP' AND p.mach_id = ".
-                    "m.mach_id ORDER BY p.name") || exit $MR_DBMS_ERR;
+                    "m.mach_id ORDER BY m.name") || exit $MR_DBMS_ERR;
 
 $sth->execute || exit $MR_DBMS_ERR;
 
 umask 022;
 open(OUT, ">$outfile") || exit $MR_OCONFIG;
+print OUT "# This File is automatically generated by Moira.  Do not edit.\n";
 
-while (($name, $hostname, $location) = $sth->fetchrow_array) {
+while (($hostname) = $sth->fetchrow_array) {
     next if $hostname eq "[NONE]";
-    $row = "$name\t$hostname\t$location\n";
+    $row = "$hostname\n";
     $row =~ s/\0//g;
     print OUT $row;
 }
This page took 0.040142 seconds and 5 git commands to generate.