# processName=Safari.app or eventorIDName=runSafariPolicy. $jamf policy $5 Here's what I have now: #!/bin/sh ProcessRunning=$(ps aux | grep -i $processName | grep -v grep | grep -v JAMF) For jamfPolicyType, pass "-id" or "-event." Thanks, I didn't think that was an issue :) If it's not too much to ask, can someone please sift through the provided code and let me know where I've taken a wrong turn? Run Inventory Scan and run script again at next check-in." Regardless of whether or not the specified process is running, the same echo string is returned. Search for $jamfPolicyType triggered by $eventorIDName." Run Inventory Scan and run script again at next check-in."Įcho "$processName is NOT running. # CHECK TO SEE IF THE SPECIFIED PROCESS IS RUNNING, THEN ECHO STATEMENT DEPENDING ON CONDITIONĮcho "$processName is running. # CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 6 AND, IF SO, ASSIGN TO "eventorIDName" # CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 5 AND, IF SO, ASSIGN TO "jamfPolicyType" # CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 4 AND, IF SO, ASSIGN TO "processName" # SCRIPT CONTENTS - DO NOT MODIFY BELOW THIS LINE # If this script is to be deployed via policy using the JSS leave the next line as is. ![]() For jamfPolicyType, pass "id" or "event." # processName=Safari or eventorIDName=runSafariPolicy. ![]() # Delete the double quotes and replace with the desired process name and/or event name, e.g. # A list of accepted process name values can be verified in Activity Monitor. # A HARDCODED VALUE FOR "processName," "jamfPolicyType" and "eventorIDName" CAN BE SET BELOW. If the specified process is not running, the script will execute /usr/local/bin/jamf policy -$5 $6 where jamfPolicyType=$5 and eventorIDName=$6. If it is, echo a string that states that it is running. The aim is to first search and see if a specified process ( processName=$4) is running. I am in the process of writing a short script and need your help.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |