Need Assistance with Running a Script

Ricky
Contributor

Hello Everyone,

Just shy of three weeks ago I participated in a conversation regarding [https://jamfnation.jamfsoftware.com/discussion.html?id=19398](signing users out of the App store via a script). The script does it's job when ran via Terminal or in Apple's Remote Desktop client—no issues whatsoever.

I have gone ahead and put together the following script that signs in, updates the programs, then finally signs out:

ec80e6b557cd4445a2afaa911a330a23

This works perfect when done by hand, but pushing through JAMF's Self Service causes issues. Notably "Can't Install Item. There was a problem installing Update App Store Apps. Contact your administrator."

As per the original thread, the MAS command line tool was placed in /usr/local/bin/.

1 ACCEPTED SOLUTION

roiegat
Contributor III

Well just from a script perspective you need the "#!/bin/bash" at the top to let it know to use bash. Then also add "exit 0" to let it know it ran successfully.

View solution in original post

3 REPLIES 3

roiegat
Contributor III

Well just from a script perspective you need the "#!/bin/bash" at the top to let it know to use bash. Then also add "exit 0" to let it know it ran successfully.

Ricky
Contributor

@roiegat It was the exit 0 I was missing. I tried it both with the #!/bin/bash and had the same results so I was trying to get the script as simplified as possible. Thank you for your speedy response, I greatly appreciate it!

davidacland
Honored Contributor II
Honored Contributor II

If #!/bin/bash or #!/bin/sh are missing from scripts, you might get commands failing and odd errors so I'd always recommend including it.