How to Script a check for existence/non-existence of Software app?
I have some printer drivers installed by a Canon UFRII installer routine, and I've created a Custom Inventory Rule (CIR) to mark a client machine as having X version of these drivers installed by parsing a .plist file deep in the Canon-related printer directories.
Now I need to write a script that tests to see if a client has that CIR or not, and I'm not able to think of or find a way of doing that.
In pseudo-code, it'd look something like:
if [ "CIR - Get Canon UFRII Driver version" = "10.14.0" ] then do X else do Y
Or, if I can check for a label,like:
if [ labels-on-this-client include "Has Canon UFRII 10.15.0 Driver" ] then do X else do Y
Any help?
Thanks!
/Kent
Now I need to write a script that tests to see if a client has that CIR or not, and I'm not able to think of or find a way of doing that.
In pseudo-code, it'd look something like:
if [ "CIR - Get Canon UFRII Driver version" = "10.14.0" ] then do X else do Y
Or, if I can check for a label,like:
if [ labels-on-this-client include "Has Canon UFRII 10.15.0 Driver" ] then do X else do Y
Any help?
Thanks!
/Kent
1 Comment
[ + ] Show comment
-
CIR can't be used like that in the KSMA, you would need to create a label to search for that CIR with the operator "software title" (if I'm not wrong) - RandomITdude24 6 years ago
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
JasonEgg
6 years ago
Top Answer
As RandomITdude suggested, creating target label(s) would be the way to go. However, I would understand if you want to avoid that if you have (for example) 10 different scenarios for 10 different configurations leading to 10 different scripts doing similar things. In that case, you could have a job which creates a file/reg key with specific properties and use a built-in script function like "Verify a product version is exactly..." or "Verify a registry value is exactly..."
Comments:
-
I resorted to just giving up on the CIR route, and writing a bash script to do what I need.
Thanks, though! - kentwest 6 years ago