Created
September 24, 2015 01:07
-
-
Save rtrouton/df24a3b1162605046a9e to your computer and use it in GitHub Desktop.
ARD task template for running commands with Casper's jamf binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CheckBinary (){ | |
# Identify location of jamf binary. | |
jamf_binary=`/usr/bin/which jamf` | |
if [[ "$jamf_binary" == "" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ ! -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/sbin/jamf" | |
elif [[ "$jamf_binary" == "" ]] && [[ ! -e "/usr/sbin/jamf" ]] && [[ -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/local/bin/jamf" | |
elif [[ "$jamf_binary" == "" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/local/bin/jamf" | |
fi | |
} | |
# Run the CheckBinary function to identify the location | |
# of the jamf binary for the jamf_binary variable. | |
CheckBinary | |
$jamf_binary command_goes_here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment