Posted on 10-14-2016 04:04 PM
I'm pushing a script to change firefox settings that uses as a wildcard. When I run the script locally, the script executes with no issues. When I push from Casper, it doesn't recognize as a wildcard. See script below.
I'm using a * because the profile names are randomized for Firefox. For example, mine is 71jal12.default.
currentuser=stat -f "%Su" /dev/console
echo user_pref("network.automatic-ntlm-auth.trusted-uris", "iwa.com"); >> /Users/$currentuser/Library/Application Support/Firefox/Profiles/.default/prefs.js
echo user_pref("network.negotiate-auth.trusted-uris", "iwa.com"); >> /Users/$currentuser/Library/Application Support/Firefox/Profiles/.default/prefs.js
Output from JAMF log -
/Users/bwong/Library/Application Support/Firefox/Profiles/.default/prefs.js: No such file or directory
/Library/Application Support/JAMF/tmp/enableSSOBrowsers: line 13: /Users/bwong/Library/Application Support/Firefox/Profiles/.default/prefs.js: No such file or directory
Posted on 10-17-2016 09:25 AM
Try
echo 'user_pref("network.automatic-ntlm-auth.trusted-uris", "iwa.com");' >> /Users/"$currentuser"/Library/Application Support/Firefox/Profiles/*.default/prefs.js
echo 'user_pref("network.negotiate-auth.trusted-uris", "iwa.com");' >> /Users/"$currentuser"/Library/Application Support/Firefox/Profiles/*.default/prefs.js
Posted on 10-17-2016 09:56 AM
I ended up using the following. Thanks!
echo user_pref("network.automatic-ntlm-auth.trusted-uris", "*iwa..com"); >> /Users/$currentuser/Library/Application Support/Firefox/Profiles/*.default/prefs.js
echo user_pref("network.negotiate-auth.trusted-uris", "*iwa..com"); >> /Users/$currentuser/Library/Application Support/Firefox/Profiles/*.default/prefs.js
Posted on 10-17-2016 10:04 AM
This applies more to double quoting rather than single quoting, but a good rule of thumb is to use quotes, unless you have a specific reason not to. Makes life way easier :)
Posted on 10-17-2016 03:21 PM
Gotcha. I also found another thing. It doesn't work if I'm using #!/bin/sh... switched it to #!/bin/bash and it started working.
Posted on 10-18-2016 09:31 AM
Spoke too soon... appears to be working on 3/4 of our machines. Some machines are still not taking the *.
JAMF Log --
/Users/bwong/Library/Application Support/Firefox/Profiles/.default/prefs.js: No such file or directory
/Library/Application Support/JAMF/tmp/enableSSOBrowsers: line 13: /Users/bwong/Library/Application Support/Firefox/Profiles/.default/prefs.js: No such file or directory
Posted on 10-18-2016 09:40 AM
Spoke too soon again... found out that some user's firefox profiles were not just like 5sjl23i.default...but they were 5al369aj.default-18559871
I added a .default and it's working now.