Stopping Server Services

jamesdurler
Contributor

Hello everyone,

I have a mac server build script which is functionalised.

One of the functions simply stops services. if i execute this script manually through terminal it works fine. However, when using self service to deploy this script I get the following errors:

/Library/Application Support/JAMF/tmp/setupMacServer.sh: line 357: serveradmin: command not found /Library/Application Support/JAMF/tmp/setupMacServer.sh: line 358: serveradmin: command not found /Library/Application Support/JAMF/tmp/setupMacServer.sh: line 359: serveradmin: command not found /Library/Application Support/JAMF/tmp/setupMacServer.sh: line 360: serveradmin: command not found /Library/Application Support/JAMF/tmp/setupMacServer.sh: line 361: serveradmin: command not found /Library/Application Support/JAMF/tmp/setupMacServer.sh: line 362: serveradmin: command not found /Library/Application Support/JAMF/tmp/setupMacServer.sh: line 363: serveradmin: command not found

This is the function , please note lines 357-363 relate to serveradmin stop commands below.

function stopServices {

# Insert blank line into the log file echo "" >> $LOG echo `date` - Stopping services before configuration >> $LOG serveradmin stop afp | tee -a $LOG serveradmin stop smb | tee -a $LOG serveradmin stop web | tee -a $LOG serveradmin stop nfs | tee -a $LOG serveradmin stop netboot | tee -a $LOG serveradmin stop sharing | tee -a $LOG serveradmin settings info:enableSNMP = no | tee -a $LOG

}

No idea why this would fail when deploying through self service?

0 REPLIES 0