Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Scripts/install-large-pkg/InstallLargePKG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ successTest() {
# Test if last run command was successful
if [ $? -ne 0 ]; then
echo "$1"
killall caffeinate
exit 1
fi
}
Expand All @@ -70,7 +69,6 @@ downloadFile() {
(( dlTries++ ))
if [ "$dlTries" == 11 ]; then
echo "Download has failed 10 times, exiting"
killall caffeinate
exit 1
fi
/usr/bin/curl -Ls "$finalURL" -o "$pathToFile"
Expand Down Expand Up @@ -121,8 +119,9 @@ else
/bin/mkdir "$tmpDir"
fi

# Keep machine awake, as if user is active.
/usr/bin/caffeinate -disu &
# Keep machine awake, as if user is active.
# Clear caffeinate automatically upon script termination.
/usr/bin/caffeinate -disu -w $$ &

# Download & Validate File
dlSize=$(getDownloadSize)
Expand All @@ -132,7 +131,6 @@ while [ "$fileChecksum" != "$dlSUM" ]; do
(( vfTries++ ))
if [ $vfTries == 4 ]; then
echo "Download and Verification has failed 3 times, exiting..."
killall caffeinate
exit 1
fi
downloadFile &
Expand All @@ -158,7 +156,6 @@ installPKG

# Cleanup
echo "Cleaning up files and processes..."
killall caffeinate
sleep 10
/bin/rm -R "$tmpDir"

Expand Down