Posted on 02-07-2024 05:07 AM
Hello everyone
Sorry - I'm new to jamf.
I need to create a policy that inserts a line in a config file.
Do you have any ideas on how I should proceed here?
Best regards
Solved! Go to Solution.
Posted on 02-07-2024 08:09 AM
Can you give us a little more detail here? By "config file" you don't mean a Configuration Profile, right? You're talking about a local file, like a config.ini or something along those lines sitting on the Mac?
If the insert is just a new line, and not replacing anything, it's not hard to do in a script. You can typically just echo a new line into the file, like /bin/echo "some new line" >> /path/to/config
If it has to change an existing line, then you would use sed for that, not echo.
Posted on 02-07-2024 08:09 AM
Can you give us a little more detail here? By "config file" you don't mean a Configuration Profile, right? You're talking about a local file, like a config.ini or something along those lines sitting on the Mac?
If the insert is just a new line, and not replacing anything, it's not hard to do in a script. You can typically just echo a new line into the file, like /bin/echo "some new line" >> /path/to/config
If it has to change an existing line, then you would use sed for that, not echo.
Posted on 02-08-2024 05:39 AM
Hi @mm2270
Sorry, I will give little more details next time.
You've helped me a lot!
Thanks again.