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