Posted on
09-14-2017
07:31 AM
- last edited
Tuesday
by
kh-richa_mig
Can someone is able to explain to me why this script works locally but when I try to run it from the Jamf server it does not fail but it does nothing. the echo give me the actual login user in the logs.
#!/bin/bash
currentuser=""
currentuser=`/bin/ls -la /dev/console | /usr/bin/cut -d " " -f 4`
echo $currentuser
defaults write /Users/$currentuser/Library/Preferences/com.apple.Safari ManagedPlugInPolicies ' "com.macromedia.Flash Player.plugin" = {
PlugInDisallowPromptBeforeUseDialog = 1;
PlugInFirstVisitPolicy = PlugInPolicyAllowWithSecurityRestrictions;
PlugInHostnamePolicies = (
{
PlugInHostname = "www.adobe.com";
PlugInIsFreshlyExpired = 0;
PlugInPageURL = "http://www.adobe.com/uk/software/flash/about/";
PlugInPolicy = PlugInPolicyAllowWithSecurityRestrictions;
PlugInRunUnsandboxed = 1;
}
);
PlugInRunUnsandboxedOnFirstVisit = 1;
};
'
exit 0
Posted on 09-14-2017 08:54 AM
Might want to move this into a Configuration Profile. Much easier to manage.
You have currentuser
listed twice?
Posted on 09-14-2017 09:45 AM
@donmontalvo I'm assuming he's setting current user as null first just to make sure it's empty to start with. Not really something done in bash. It could probably be removed and it would be fine.