Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaunchDaemon not valid #10

Closed
mm2270 opened this issue Mar 30, 2017 · 3 comments
Closed

LaunchDaemon not valid #10

mm2270 opened this issue Mar 30, 2017 · 3 comments
Labels

Comments

@mm2270
Copy link

mm2270 commented Mar 30, 2017

Hi there. Someone pointed me to this script to look at because they are using it and finding that the LaunchDaemon isn't working. It doesn't load and run the script to cleanup after the OS upgrade.

I took a look at it and found that the method being used to create the plist is creating an invalid plist because none of the double quotes within it are being retained.

My suggestion for fixing this are to change the section where it creates the LaunchDaemon to the following:

cat << EOF > /Library/LaunchDaemons/com.jamfps.cleanupOSInstall.plist
<?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>com.jamfps.cleanupOSInstall</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/jamfps/finishOSInstall.sh</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>
EOF

The HEREDOC method above retains the quotes and doesn't require using any backslashes to escape them in the plist.

@cpwasthere
Copy link

cpwasthere commented Mar 30, 2017

@mm2270 I can confirm your changes ensure a correct creation of the plist and then deletion of the macOS installer after the reboot into sierra. Thanks.

@kc9wwh
Copy link
Owner

kc9wwh commented Mar 30, 2017

Thanks @mm2270! I haven't had much time to look at this, so really appreciate this!

I'll run it through and test everything next week and get it updated.

@kc9wwh kc9wwh added the bug label Mar 30, 2017
kc9wwh pushed a commit that referenced this issue Apr 5, 2017
**Please be aware of Issue #12**
Fixed Issue #8
Fixed Issue #9
Fixed Issue #10
@kc9wwh
Copy link
Owner

kc9wwh commented Apr 5, 2017

Fixed in v1.7

Thank you @mm2270!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants