I am using Altiris Deployment Server that runs a job on some Mac computers that we have. The job is very simple and is comprised of two parts.
Job: Deploy the Altiris NS Agent for Mac
Task1: Copy file to
Details: Copy from \\server\share1\aex-bootstrap.Z to / (root on Mac HD)
Task2: Run Script
cd / (changes to root)
uncompress aex-bootstrap.Z && chmod u+x aex-bootstrap && sudo ./aex-bootstrap http://altiris_server.acme.com
The run script basically is doing a change dir to the root (where the file was copied in task1). Then it has a set of commands chained together.
The uncompress command works perfectly, the aex-bootstrap.Z file becomes uncompress as aex-bootstrap on the root. The change mod to executable command is also functioning as intended. The problem happens when the sudo command is used to assume super user status to execute aex-bootstrap from the current dir and set the location of the Altiris Notification Server.
Question is this: How do you solve this problem? It wouldn't be smart to pass the password in the script (if it's even possible) but I wonder if it is the only possible solution. I thought about editing the list of sudoers but I do not wish to attempt this as I would need to repeat this task on 300 computers.