However, I keep getting an error when the script runs this line:
jamf enroll -invitation $invitationCode -noRecon -noPolicy
The enrollment in fact goes well, and the the device ends up working as expected, but I get the following error:
7170 Illegal instruction: 4 jamf enroll -invitation $invitationCode -noRecon -noPolicy
Strangely, if I run the command on the Terminal, I don't get the error.
I've checked here and there, and it seems that the error is more related to dylibs that the script, of course, is not touching.
Has any of you came across this kind of problem?
Echo will just let you see that something valid is in the enrollment invitation- to make sure there's not bad characters or no content!
Are you using the correct dash for NoRecon and noPolicy? – — - are three different dashes. You might want to try without the noRecon and noPolicy just to see if the error goes away? -t-
In fact, I know that the command ends up working correctly (invitation, options and all) because the machines end up enrolled as expected…
So I suppose it's only an error that shows on the stdout, and it comes from one of the tasks that the enroll command triggers, rather than from the command itself.