Firefox 34 and newer CCK2 lockdown detection Casper Extension Attributes

Hey again!
As mentioned in my previous blog, with version 34 and 35 of Firefox, Mozilla changed the locations for the lock-down files. As a result, my previous Casper Extension Attribute would not correctly detect that the lock-downs are installed for these versions of Firefox.
So I got off my backside and re-wrote it!

Extension Attribute Configuration

The EA configuration is the same as the previous blog , and this should be used.

Extension Attribute Script

Here’s the new script:
firefox 34 extension atrribute configuration
This now breaks down as:
Line 1                         The shebang. Lets the device know it’s a bash script
Lines 4 and 5         The two possible locations for the lock down files
Lines 8 and 9         This section grabs the version number (CFBundleShortVersionString) and strips out all except the first number before the dot.
Line 12                      This runs an ‘if’ statement asking if the number grabbed from lines 8 and 9 above is less than 34
Lines 14 to 17         This echos out the version found, then sets the items to check to the ‘old’ location (e.g. “MacOS”)
Line 18                      If the ‘if’ statement from line 12 is false, another statement runs asking if the number is equal to 34.
Lines 20 to 23       This echos out the version found, then sets the items to check to the ‘old’ location (e.g. “MacOS”) for all except the autoconfig file, which is in the ‘new’ location (e.g. “Resources”)
Line 18                      If the ‘if’ statements from line 12 and line 18 are false, another statement runs asking if the number is greater than 34.
Lines 20 to 23       This echos out the version found, then sets the items to check to the ‘new’ location (e.g. “Resources”).
Line 30                     Close the “if” statement
Line 33                     This runs a multi-input “if” statement. The use of the double pipes (“||”) denotes “or”. If you swapped these for double ampersands (“&&”) is would denote “and”.  So this line says “(if directory ‘$distDir’ does NOT exist) or (if file ‘$overrideFile’ does NOT exist) or (if file ‘$autoconfigFile’ does NOT Exist), do then section between “then” and “else”.
Line 36                     Echo into the Casper EA the word “No”. Essentially if any of those items are missing, then at least part of the customisations are missing and the whole lot should be reinstalled.
Line 39                     Echo into the Casper EA the word “Yes”. If none of those items are missing, then the customisations should be in place and working fine.
Line 40                     Close the “if” statement
Line 42                     Exit the script

Usage

Again, this is identical to my previous blog on this subject.
The only ‘gotcha’ is because of the varying locations; you will need have multiple lock-down installer packages and scope them to devices that are:
a)    Missing the CCK 2 lockdowns
b)    Have Firefox version

  1. 34 for the v34 lockdown package
  2. 35 for the v35 lockdown package
  3. etc

Summary

There you go. I hope it continues to help someone out and saves you some time. As before, attached to this blog is an export of the EA. You can download this, upload it to your JSS and tweak it as desired.
As always, if you have any questions, queries or comments, let us know below and I’ll try to respond to and delve into as many as I can.
Disclaimer:
While the author has taken care to provide our readers with accurate information, please use your discretion before acting upon information based on the blog post. Amsys will not compensate you in any way whatsoever if you ever happen to suffer a loss/inconvenience/damage because of/while making use of information in this blog.