FYI unlockAddPrinters.sh broken on 10.10

denmoff
Contributor III

I've been using this script to add the ability to add and remove printers for standard users. It's basically just adding the user group "everyone" to the lpadmins group. I've found that it stopped working when 10.10 came out. The offending code in the script is an if statement comparison that wants to make sure it only runs on 10.5.7 or greater. It's trying to compare 10.10 to 10.5. This comparison fails for a couple of reasons. My first assumption was that it was because it thinks 10.10 is really 10.1, so that appears to be less than 10.5. But the actual issue, which i'm surprised wasn't an issue earlier, is that bash doesn't handle floating point comparison well. So, my solution was just to remove the comparison all together since I have no 10.5 systems in my JSS anymore.

4 REPLIES 4

pblake
Contributor III

Why not take the OS check out of the script. Who is managing Mac clients below 10.5.7? I have nothing below 10.8.5 in my environment.

mm2270
Legendary Contributor III

In complete agreement with @pblake I've just been nuking the whole OS check and comparison in these older scripts. Its just busy work now and not needed anymore, since its only used if the Mac happens to be pre 10.5 in most cases. I can't imagine anyone is actually managing Macs running such an outdated OS at this point. We still have a small number of Macs running 10.6.8, but they are few and far between and are almost phased out at this point.

RobertHammen
Valued Contributor II

10.10.x broke version detection in so many scripts. Even Casper Imaging ;-)

denmoff
Contributor III

@pblake @mm2270 That's what i did. I removed the comparison all together. Did you miss the last sentence in my original post? :-)