09-29-2021 03:32 PM - edited 09-29-2021 03:45 PM
Hi guys, still a bit new to JAMF, apologies, but thanks for the assistance so far!
I don't have access to Composer yet, but I do have a working script that goes out to the web, pulls an xml (plain text config file for an application configuration) to the users machine, then places that xml file into the users application support folder. Works perfectly. However, I don't have a location that I can host this said xml file, therefore, I think I would need to create a package that have the file inside of it, has a script that places the file in the correct location, and have Jamf run that package after installing a certain application.
Or am I going about this the wrong way? Should I just have a script that creates this text file from within the script, saves it as an xml, and places it in the users application support folder? Would that be better? Pros? Cons? Thanks for any input.
Solved! Go to Solution.
Posted on 09-30-2021 02:30 PM
you could always make a script that lives in Jamf / deployed from Jamf via policy that writes out the XML in the location you need. see below for a crude example of what I'm talking about. This way you never need to package and deploy it & can change it on the fly.
#!/bin/bash
mkdir /Library/Preferences/DirectoryLocation/
touch /Library/Preferences/DirectoryLocation/FILEHERE.xml
OutputXML=/Library/Preferences/DirectoryLocation/FILEHERE.xml
{
echo "<?xml version=\"1.0\" encoding=\"Shift-JIS\"?>"
echo "<Configuration>"
echo "<title>Title Here</title>"
echo "</Configuration>"
} > ${OutputXML}
Posted on 09-30-2021 02:03 PM
Composer is the way to go but AutoPkgr will also save you a lot of time for any apps you can get from there. At least you won't have to re-create the wheel for quite a few.
Posted on 09-30-2021 02:30 PM
you could always make a script that lives in Jamf / deployed from Jamf via policy that writes out the XML in the location you need. see below for a crude example of what I'm talking about. This way you never need to package and deploy it & can change it on the fly.
#!/bin/bash
mkdir /Library/Preferences/DirectoryLocation/
touch /Library/Preferences/DirectoryLocation/FILEHERE.xml
OutputXML=/Library/Preferences/DirectoryLocation/FILEHERE.xml
{
echo "<?xml version=\"1.0\" encoding=\"Shift-JIS\"?>"
echo "<Configuration>"
echo "<title>Title Here</title>"
echo "</Configuration>"
} > ${OutputXML}
Posted on 09-30-2021 02:56 PM
Exactly what I was looking for, and although I could have used the above AutoPkgr, I feel like this simple script for a simple file that doesn't change is just fine for now. Thanks a bunch!
Posted on 09-30-2021 02:59 PM
You're welcome @jaycruz145
09-30-2021 03:09 PM - edited 09-30-2021 04:13 PM
But question, will this work with placing something in the users library? I saw something about using a $3 to designate the current user instead of the ~ for the current users directory.
EDIT: Worked, got another little bug regarding permissions, but overall, it did work mostly correctly, thanks!