Posted on 08-29-2023 01:55 PM
Hello I am new to scripting and i found this script online and i showed it to my boss he said "the script is good and it will work" he then asked me "how would that script look if it were to be in jamf extension"
Here is the script i showed him i am assuming we are going to be using this script in jamf attributes extension but for it to be valid in jamf do i just need to add a results tag? how can this script be acceptable as a jamf extension?
Posted on 08-29-2023 02:05 PM
code is fine, but what exactly do you want the EA to return..
Posted on 08-29-2023 02:08 PM
we just wanted to get a return of whatever version of slack a user currently has so we would run the script for example and tell us if the user currently has the silicon version of slack or the intel or the universal version of slack
Posted on 08-29-2023 02:13 PM
thats cool, but whats the end game? you can just use JAMF apps and scope that for all Slack installs and that will take care of updates.. So you report back the binary version and then.. ? (unless your on prem.. then..)
Posted on 08-29-2023 02:14 PM
one of the things my boss asked me was "how can you update that script so it would work as a jamf extension" i never used jamf extensions before so that is why i asked i wanted to know more
08-29-2023 02:20 PM - edited 08-29-2023 02:24 PM
ahh.. ok.. yea.. get whatever you need to parse into an variable.. $usefulldata
echo "<result>$usefulldata</result>"
will enter that into the EA, that you can then scope / report on..
if there is no data, I keep the variable empty..
NOTE!! important.. EAs run as ROOT, and will execute what-ever you enter. and for EVERY DEVICE...
So, every EA you build.. make as a policy / script .. assign, test.. test again. maybe.. again.. THEN add as an EA.. 😎
Posted on 08-29-2023 03:09 PM
hey can you please do me a favor this script can you run it on your end please it is giving me syntax errors and i do not know why
Posted on 08-29-2023 03:09 PM
Posted on 08-29-2023 08:52 PM
so with the script i am getting an error on line 7 and i do not know why and i do not know how to resolve the issue please help (:
Posted on 08-30-2023 08:10 AM
I see 2 possible things wrong with the script in your image. First, the first line in the case statement should be "x86_64 arm64", not just "x86_64" as you have it now. Otherwise, it will never detect any Universal versions of the application since the command outputs both the x86 and arm64 tags with universal apps.
Second thing, and this may be the reason for your error, is you should have a space between echo and "<result> for each line in your case statement. Spaces are important in shell scripts as they act as delineators between commands and other pieces of information. You can't smush them together like that.