How to best deploy a plist and a script?

StaplesApples
New Contributor

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 2

Look
Valued Contributor III

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.

khey
Contributor

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>