Created
February 11, 2019 17:54
-
-
Save smashism/2f2df4526c9baf1ae1d559d491ca9d6e to your computer and use it in GitHub Desktop.
function to check jamf pro server (JPS) connection in a shell script. jps variable must be set.
This file contains hidden or 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
function checkJPSConnection { | |
n=0 | |
until [[ $n -ge 12 ]]; do | |
checkAvailablity=$(${jamfBinary} checkJSSConnection) | |
# Function exitStatus | |
if [[ $checkAvailablity == *"${jps}"* ]]; then | |
echo "${jps} is available, continuing..." | |
break | |
else | |
echo "${jps} is unavailable at this time. Suspending until next interval..." | |
sleep 10 | |
n=$((n+1)) | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment