jamf / DEPNotify-Starter

Bash script to start DEPNotify and run policies during enrollment with Jamf Pro
https://gitlab.com/Mactroll/DEPNotify
MIT License
369 stars 85 forks source link

Issue with depNotify.sh #9

Closed Hugonauts closed 5 years ago

Hugonauts commented 5 years ago

Hello,

I created a launchagent to kick off the depNotify.sh on login and it does launch it, the problem is, whether the test flag is true or false, it runs through and doesn't actually trigger the policies. Can you review my script and advise on what I did wrong? I barely modified anything.

I have the shell script saved on a web server and i have it downloaded to the computer via a curl command script in a policy so it can be modified on the fly without the need to constantly recreate a package. I am chmoding it 777. Any advice would really help as it worked once and then stopped working on all the machines ive tested on. Machines are running OEM 10.13.6.

depNotify.sh.zip

kbareis commented 5 years ago

👋 @Hugonauts! I took a look at your script and you are right not many changes. I would expect the script not to run the policies in TESTING_MODE as that is the expected behavior. depNotify.sh script looks good and I tested the policy names with special characters so that shouldn't be a problem.

On the computer you having issues on. Can you try the following command and post the behavior? sudo /usr/local/bin/jamf policy -event audacity

If you get a warning or error about not finding the Jamf verb check to make sure that the jamf binary is in /usr/local/bin/jamf. If it is not there, then you will need to edit line 116 where it says JAMF_BINARY="/usr/local/bin/jamf" or upgrade Jamf Pro to a newer version.

Hugonauts commented 5 years ago

Thank you, i will check first thing tomorrow once i'm back in the office. we're on jamf pro version 10.8. Now I haven't chowned it root:wheel, I'm also going to test that, is that something that might cause a problem (if it's not chowned root:wheel?)

kbareis commented 5 years ago

@Hugonauts also try the 1.2.0 version that was released today. I moved from calling the binary within the app to just calling the app. Some folks in Slack said that the older method had some issues.

Jamf Pro 10.8 should have the binary in the proper place for the script using macOS 10.13. I believe, when SIP was added, that we had to move the binary and made some changes there.

Hugonauts commented 5 years ago

trying the 1.2.0 version and still encountering same problem. when running the command manually, everything works fine. I just installed the DepNotify application package, should I install the binary as well? I don't see that it calls on it in your script since everything is in /applications/utilities/depnotify.app and as far as I can tell, the binary is literally just the app.

i will continue the troubleshooting and let you know if i find anything!

Hugonauts commented 5 years ago

Also, Trying it on Mojave now. No Dice. Experiencing the same thing..

Hugonauts commented 5 years ago

So I ended up putting into a script in my jamf server and it is working now =/

Thank you for your help. Much appreciated!

kbareis commented 5 years ago

@Hugonauts if you keep trying things with LaunchD, check out https://yearofthegeek.net/2018/05/updating-our-depnotify-process/ @jmahlman did a session at JNUC about how he uses that method.

sjha967 commented 3 years ago

how to fix Recalculating Spines. Just before weeks, it was working fine and showing the enrollment process but now getting Recalculating Spines