I think you are missing line 4 in Step 5 from your script. This is where the $this_user variable is defined. If the $this_user variable is not defined the script wont know where to put the files and will error out.
#!/bin/bash
#Get the current user on a device. Notice the back-quote for embedding the python script.
this_user=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name
&& ! /loginwindow/ { print $3 }')
# Copy the Agent pkg file to the home or shared directory of the user.
# Use the copy method for your distribution system.
#Set up the pkg file with full logs, placing the Agent files in the home directory of the user.
su -l $this_user -c "/usr/sbin/installer -verboseR -dumplog -pkg /Users/$this_user/mac-agent.pkg -target CurrentUserHomeDirectory"
Also, in Monterey (not sure of the version) Apple has removed Python, so if your installer is using Python it will fail on these devices. I think the latest installer from Aternity no longer uses Python.
Also, in Monterey (not sure of the version) Apple has removed Python, so if your installer is using Python it will fail on these devices. I think the latest installer from Aternity no longer uses Python.
Apple removed Python 2.7, not Python as a whole. They did this with 12.3 back in March. You must now use Python 3, so any scripts using Python 2.7 need to be updated to function.
Apple removed Python 2.7, not Python as a whole. They did this with 12.3 back in March. You must now use Python 3, so any scripts using Python 2.7 need to be updated to function.
Correct.
Script adjusted and deployment testing
Hi @AJPinto
Indeed, i have this error:

Could you please help me fixed, I sam not good at scripting :(
Thanks