EXEC SQL WHENEVER SQLERROR DO sqlerr();
/* Get print spoolers for allow lists. */
- EXEC SQL SELECT COUNT(service) INTO :alcount FROM serverhosts
- WHERE service = 'PRINT';
+ EXEC SQL SELECT COUNT(service) INTO :alcount FROM serverhosts sh
+ WHERE sh.service = 'PRINT' or sh.service = 'CUPS-PRINT';
allowlist = malloc(alcount * sizeof(*allowlist));
EXEC SQL DECLARE csr_spool CURSOR FOR
SELECT m.address, sh.value3 FROM machine m, serverhosts sh
- WHERE m.mach_id = sh.mach_id AND sh.service = 'PRINT';
+ WHERE m.mach_id = sh.mach_id AND
+ (sh.service = 'PRINT' OR sh.service = 'CUPS-PRINT');
EXEC SQL OPEN csr_spool;
for (i = 0; i < alcount; i++)
{
"\t:ht=ethernet:\\\n\t:ha=%s:\\\n\t:ip=%s:\\\n"
"\t:lg=%s:\\\n\t:vm=rfc1048:",
shortname, location, contact, name, net, hwaddr, addr, logaddr);
- if (!strcmp(hwtype, "HP"))
+ if (!strncmp(hwtype, "HP", 2))
fprintf(out, "\\\n\t:T144=\"/hp/%s\":", shortname);
fprintf(out, "\n\n");
}
SELECT LOWER(m.name), m.hwaddr, m2.address, m3.address, pr.type,
pr.location, pr.contact, TO_CHAR(pr.modtime, :unixtime_fmt)
FROM printers pr, machine m, machine m2, machine m3
- WHERE pr.hwtype = 'HP' AND pr.mach_id != 0
+ WHERE pr.hwtype LIKE 'HP%' AND pr.mach_id != 0
AND pr.mach_id = m.mach_id AND pr.rm = m2.mach_id
AND pr.loghost = m3.mach_id AND pr.type != 'ALIAS';
EXEC SQL OPEN csr_boot2;