Skip to main content
Question

How to best deploy a plist and a script?


Forum|alt.badge.img+3

Hi,

Am struggling a bit with deploying a plist and script.

What i am trying to achieve is that i deploy the plist in the launchdeamon folder and the script in the scripts folder in a subfolder.

Options i tried:
1. Tried to package it and then deploy it directly in those folders but that doesn't work.
2. Created a DMG and copy it by default in the /Library/Application SupportJamf folder and then move it to the appropiate folders but that also doesn't work.

So the question is, does anyone have a hint on how to do this in a correct way?

In short i want to deploy the .plist in /Library/LaunchDeamons and the script in /Library/Script/Subfolder and then launch the deamon with sudo launchctl load -w /Library/LaunchDaemons/com.company.networkwatcher.plist

When i manually deploy it works nicely but i want to have it scoped by JAMF as a policy as it is a policy for automatic switching between LAN / WIFi.

Thanks,

Dennis

2 replies

Forum|alt.badge.img+16
  • Valued Contributor
  • 1002 replies
  • August 8, 2018

You can definitely deploy LaunchDaemons and scripts using drag and drop creation Composer, if it's in the correct place on the target but not running I would check the permissions on the plist in Composer, almost every time I have had issues with this it was the permissions set in Composer that were the issue.


Forum|alt.badge.img+7
  • Valued Contributor
  • 69 replies
  • August 9, 2018

The way i did it is by using a plist to run the Script at load and place it inside LaunchAgents so it runs everytime somebody logged in.

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>net.plistname</string> <key>ProgramArguments</key> <array> <string>sh</string> <string>/Library/Scripts/Subfolderscript.sh</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings