Skip to content

Commit

Permalink
ran shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
mpanighetti committed Apr 3, 2020
1 parent 1185ffe commit 7fb658e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions payload/Library/Scripts/Install or Defer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ if [[ ! -x "$JAMFHELPER" ]]; then
fi

# Bail out if the jamf binary doesn't exist.
JAMF_BINARY=$(which jamf)
if [[ -z $JAMF_BINARY ]]; then
JAMF_BINARY="/usr/local/bin/jamf"
if [[ ! -e "$JAMF_BINARY" ]]; then
echo "[ERROR] The jamf binary could not be found."
BAILOUT=true
fi
Expand Down Expand Up @@ -356,11 +356,7 @@ else
fi

# We need to be connected to the internet in order to download updates.
ping -q -c 1 208.67.222.222 &>/dev/null
if [[ $? -ne 0 ]]; then
echo "[ERROR] No connection to the Internet."
BAILOUT=true
else
if ping -q -c 1 208.67.222.222; then
# Check if a custom CatalogURL is set and if it is available
SU_CATALOG=$(python -c 'from Foundation import CFPreferencesCopyAppValue; print CFPreferencesCopyAppValue("CatalogURL", "com.apple.SoftwareUpdate")')
if [[ "$SU_CATALOG" != "None" ]]; then
Expand All @@ -369,6 +365,9 @@ else
BAILOUT=true
fi
fi
else
echo "[ERROR] No connection to the Internet."
BAILOUT=true
fi

# If FileVault encryption or decryption is in progress, installing updates that
Expand Down Expand Up @@ -411,7 +410,7 @@ else
echo "Max deferral time undefined, or not set to a positive integer. Using default value."
fi
fi
echo "Maximum deferral time: $(convert_seconds $MAX_DEFERRAL_TIME)"
echo "Maximum deferral time: $(convert_seconds "$MAX_DEFERRAL_TIME")"

# Perform first run tasks, including calculating deadline.
FORCE_DATE=$(defaults read "$PLIST" AppleSoftwareUpdatesForcedAfter 2>/dev/null)
Expand Down

0 comments on commit 7fb658e

Please sign in to comment.